當有兩張網卡的時候,一張接ADSL,一張接家理switch該如何設定網卡IP Address

$ sudo vi /etc/network/interfaces

auto lo
iface lo inet loopback


auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider

#上面不要動到,修改下面的增加 eth1
auto eth0 eth1
iface eth0 inet manual
#eth1使用固定IP,輸入IP、netmask 既可
iface eth1 inet static
address 192.168.2.46
netmask 255.255.255.0
# gateway 192.168.2.1

#DHCP的設定
iface eth1 inet dhcp

重新啟動服務就OK囉
$ sudo /etc/init.d/networking restart

$ sudo vi /etc/resolv.conf
nameserver 168.95.1.1
nameserver 168.95.192.1

arrow
arrow
    全站熱搜

    蒼穹 發表在 痞客邦 留言(0) 人氣()