歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 在Debian Linux中網卡的設置

在Debian Linux中網卡的設置

日期:2017/2/28 17:58:14   编辑:Linux教程
在Debian中網卡的設置可以通過/etc/network/interfaces文件來進行,具體可分為三種不同的配置方式:DHCP自動獲取、靜態分配IP地址和PPPoE寬帶撥號。具體設置如下: 在進行配置之前,首先進入/etc/network目錄中,編輯interfaces文件:
網卡通過DHCP自動獲取IP地址
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
#
# The loopback network interface(配置環回口)
# 開機自動激lo接口
auto lo
# 配置lo接口為環回口
iface lo inet loopback
#
# The primary network interface (配置主網絡接口)
#開機自動激活eth0接口
auto eth0
#配置eth0接口為DHCP自動獲取
iface eth0 inet dhcp
網卡靜態分配IP地址
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
#
# The loopback network interface(配置環回口)
# 開機自動激lo接口
auto lo
# 配置lo接口為環回口
iface lo inet loopback
#
# The primary network interface (配置主網絡接口)
#開機自動激活eth0接口
auto eth0
#配置eth0接口為靜態設置IP地址
iface eth0 inet static
address 10.16.3.99
netmask 255.255.255.0
network 10.16.3.0
broadcast 10.16.3.255
gateway 10.16.3.1
# dns-* options are implemented by the resolvconf package, if installed(DNS設置)
dns-nameservers 61.153.177.196 61.153.177.197
dns-search fireteam.org
網卡進行PPPoE寬帶撥號配置
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
#
# The loopback network interface(配置環回口)
# 開機自動激lo接口
auto lo
# 配置lo接口為環回口
iface lo inet loopback
#
# The primary network interface (配置主網絡接口)
#開機自動激活eth0接口
auto eth0
#配置eth0接口為靜態設置IP地址
iface eth0 inet static
address 10.16.3.99
netmask 255.255.255.0
network 10.16.3.0
broadcast 10.16.3.255
配置完畢後,重啟計算機或網絡服務即可將網卡配好。如進行PPPoE寬帶撥號,可運行pppoeconf命令進行配置。
Copyright © Linux教程網 All Rights Reserved