RedHat/CentOSϵÁÐ
1¡¢Ìí¼ÓÍø¿¨
2¡¢²é¿´Íø¿¨ÊÇ·ñʶ±ð
vi /etc/udev/rules.d/70-persistent-net.rules #¿ÉÒÔ¿´µ½ÓÐÁ½¿éÍø¿¨
3¡¢´´½¨ifcfg-eht1Íø¿¨ÅäÖÃÎļþ
cd /etc/sysconfig/network-scripts/
cp ifcfg-eht0 ifcfg-eht1
4¡¢±à¼Ð޸ĸ´ÖƵÄifcfg-eth1(ÐÞ¸ÄmacµØÖ·£¬Íø¿¨Ãû³ÆµÈ)
5¡¢ÉúЧÅäÖÃ
/etc/init.d/network reload
service network restart
Debian/UbuntuϵÁÐ
·½·¨Ò»£º
sudo ifconfig eth0:0 192.168.1.63 up
eth0Íø¿¨ÉÏ´´½¨Ò»¸ö½Ðeth0:0µÄÐéÄâÍø¿¨,ËûµÄµØÖ·ÊÇ:192.168.1.63
Èç¹û²»ÏëÒªÕâ¸öÐéÄâÍø¿¨ÁË,¿ÉÒÔʹÓÃÈçÏÂÃüÁîɾ³ý:
sudo ifconfig eth0:0 down
·½·¨¶þ£º
vim /etc/network/interfaces
Ìí¼Ó²¢±£´æÀýÈçÒÔÏÂÄÚÈÝ£º
auto eth0:0
iface eth0:0 inet static
address 192.168.1.63
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
ÖØÆôÍø¿¨ÉúЧ
/etc/init.d/networking restart
ÏîÄ¿ÖÐʹÓÃfedora16ϵͳ£¬×î½üÔÚÏîÄ¿ÖÐÓöµ½Ò»¸öÎÊÌ⣬Îļþϵͳ³öÏÖË𻵣¬ÏµÍ³ÎÞ·¨Æô¶¯£¬ÒòΪʱ¼ä½ôÆÈ£¬¾ÍÌæ»»ÁËÓ²ÅÌ£¬´ËʱÐèÒª¸ü¸ÄÍøÂçÅäÖ㬽«Íø¿¨Ãû³ÆÃüÃûΪeth0ºÍeth1£¬ÔÚɾ³ý70-persistent-net.rulesÎļþÖ®ºó£¬ÖØÆôϵͳ£¬·¢ÏÖûÓÐ×Ô¶¯Éú³É70-persistent-net.rules£¬Ñо¿ºÃ¾Ã£¬ÏÈ×ܽáÊÖ¶¯Éú³ÉµÄ·½·¨ÈçÏ¡£
1¡¢export MATCHADDR="00:f1:f3:1a:f0:05" eth0Íø¿¨µÄmacµØÖ·£¬Ò»¶¨ÒªÐ¡Ð´
2¡¢export INTERFACE=eth0 eth0Íø¿¨Ãû³Æ
3¡¢/lib/udev/write_net_rules
´Ëʱ»áÉú³É70-persistent-net.rulesÎļþ£¬ÄÚÈÝÈçÏÂ
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:f1:f3:1a:f0:05", KERNEL=="eth*", NAME="eth0"
4¡¢export MATCHADDR="00:f1:f3:1a:f0:06" eth1Íø¿¨µÄmacµØÖ·£¬Ò»¶¨ÒªÐ¡Ð´
5¡¢export INTERFACE=eth1 eth1Íø¿¨Ãû³Æ
6¡¢/lib/udev/write_net_rules
´ËʱÔÚ70-persistent-net.rulesÎļþ×·¼Óeth1µÄÐÅÏ¢£¬ÄÚÈÝÈçÏÂ
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:f1:f3:1a:f0:05", KERNEL=="eth*", NAME="eth0"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:f1:f3:1a:f0:06", KERNEL=="eth*", NAME="eth1"
---------------------
---------------------
×÷Õߣºaz44yao
À´Ô´£ºCSDN
ÔÎÄ£ºhttps://blog.csdn.net/az44yao/article/details/86519243