å¤ä¸ªä¸åIP段ç /etc/network/interfaces é
ç½®æ件çèä¾å¦ä¸ï¼
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 8.8.8.2
netmask 255.255.255.248
gateway 8.8.8.1 è¦æ³¨æè¿éï¼å¤ä¸ªä¸åIP段ï¼åªè¦1个gatewayé
ç½®å³å¯ï¼å
¶ä»IPä¸éè¦é
ç½®gateway
auto eth0:0
iface eth0:0 inet static
address 8.8.8.3
netmask 255.255.255.248
auto eth0:1
iface eth0:1 inet static
address 8.8.8.4
netmask 255.255.255.248
auto eth0:2
iface eth0:2 inet static
address 8.8.8.5
netmask 255.255.255.248
auto eth0:3
iface eth0:3 inet static
address 8.8.8.6
netmask 255.255.255.248
auto eth0:4
iface eth0:4 inet static
address 6.6.6.130 注æè¿éï¼è½ç¶è¿æ¯ä¸åçIP段ï¼ä½æ¯ä¸éè¦é
ç½®gatewayï¼åªéè¦é
ç½®netmaskå³å¯
netmask 255.255.255.224
auto eth0:5
iface eth0:5 inet static
address 6.6.6.131
netmask 255.255.255.224
æ´å¤ipä¹ç±»ä¼¼é
ç½®å³å¯ã
é
ç½®æ件å®æåï¼ç¨å½ä»¤ /etc/init.d/networking restart éå¯ç½ç»ï¼ä¸éè¦rebootéå¯æå¡å¨ã /etc/init.d/networking restart éå¯ç½ç»çæ¶åï¼å¦æä½ çé
ç½®æ件æé误ï¼é£ä¹ä»ä¼æç¤ºä½ ãæ¯å¦IPéå¤äºï¼ä¹¦åé误äºï¼ççãå¨æ§è¡æ¤å½ä»¤åï¼ä¸å®è¦å°å¿æ£æ¥interfacesé
ç½®æ件ï¼ä¸ç¶å¯è½å°±æç½ç»å¼ç«çªï¼é£æ¶åå°±éè¦æºæ¿çå·¥ä½äººåå»å¤çï¼åå麻ç¦ã
/etc/init.d/networking restarté误åææ¡ä¾ï¼
root@
www.ctohome.com:/etc/network# /etc/init.d/networking restart
* Reconfiguring network interfaces...
/etc/network/interfaces:165: interface eth0:28 declared allow-auto twice
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:165: interface eth0:28 declared allow-auto twice
ifup: couldn't read interfaces file "/etc/network/interfaces"
...fail!
说æeth0:28æéå¤ï¼è§£å³åæ³ï¼vi interfacesæ¾å°eth0:28ï¼å é¤æéå¤ç
root@
www.ctohome.com:/etc/network# /etc/init.d/networking restart
* Reconfiguring network interfaces...
/etc/network/interfaces:166: duplicate interface
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:166: duplicate interface
ifup: couldn't read interfaces file "/etc/network/interfaces"
...fail!
说æ166è¡æéå¤ï¼è§£å³åæ³ï¼vi interfacesæ¾å°166è¡(set number)ï¼å é¤æéå¤ç
root@
www.ctohome.com:/etc/network# /etc/init.d/networking restart
* Reconfiguring network interfaces...
/etc/network/interfaces:162: duplicate interface
ifdown: couldn't read interfaces file "/etc/network/interfaces"
/etc/network/interfaces:162: duplicate interface
ifup: couldn't read interfaces file "/etc/network/interfaces"
说æ162è¡æéå¤ï¼è§£å³åæ³ï¼vi interfacesæ¾å°166è¡(set number)ï¼å é¤æéå¤ç