快速修改Centos网卡的MAC地址

浏览次数:6355 关键词 ( 网卡  快速  地址  Centos  )

方法1:
# ifconfig eth0 down
# ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE
# ifconfig eht0 up


方法2:
# ip link set eth1 down
# ip link set eth1 address 00:AA:BB:CC:DD:EE
# ip link set eth1 up


方法3:
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
#############
TYPE=Ethernet
DEVICE=eth0
MACADDR=00:0C:29:DF:52:DA
ONBOOT=yes
IPADDR=192.168.8.18
NETMASK=255.255.255.0
#############
# service network restart

如果您希望系统重启后还继续使用您所设置的MAC地址,那么建议使用方法3