Debian雙網卡配置


1.單網卡配置

/etc/network/interfaces

auto eth0
#iface eth0 inet dhcp(默認是DHCP被注釋掉)
iface eth0 inet static
address 192.168.8.110
netmask 255.255.255.0
gateway 192.168.8.1

2.雙網卡配置

/etc/network/interfaces

auto eth0
#iface eth0 inet dhcp(默認是DHCP被注釋掉)
iface eth0 inet static
address 192.168.8.110
netmask 255.255.255.0
gateway 192.168.8.1

auto eth1
iface eth1 inet static
address 192.168.0.110
netmask 255.255.255.0
gateway 192.168.8.1

(注意eth1沒有gateway )

3.單網卡配置多ip

修改/etc/network/interfaces

auto eth0
iface eth0 inet static
address192.168.8.110
netmask 255.255.255.0
gateway 192.168.8.1

auto eth0:0
iface eth0:0 inet static
address 192.168.0.110
netmask 255.255.255.0

修改/etc/network/ifstate

lo=lo
eth0=eth0
eth0:0=eth0:0

如果沒有/etc/network/ifstate,手工創建
/etc/init.d/networking restart
注意,eth0:0沒有gateway,此方法測試有效


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM