JDP 發表於 2011-8-30 15:02:12

設定網卡IP及DNS

1.1 設定單網卡單IP
vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254

1.2 單網卡多IP
vi /etc/network/interfaces
auto eth0:0
iface eth0:0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254

auto eth0:1
iface eth0:1 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.254

1.3 自動取得IP
vi /etc/network/interfaces
auto eth0
iface eth0 inet dhcp

2.設定DNS
vi /etc/resolv.conf
nameserver 168.95.192.1

3.重新啟動網路服務
/etc/init.d/networking restart
頁: [1]
查看完整版本: 設定網卡IP及DNS