- 论坛徽章:
- 0
|
1. sbin/ifconfig eth0 down
sbin/ifconfig eth0 hw ether 00 11 22 33 44 55
sbin/ifconfig eth0 up
通过ifconfig可以看到修改已经生效,可是重启机器后又恢复成了原来得mac.
2. vi /etc/sysconfig/network-scripts/ifup
# this isn't the same as the MAC in the configuration filename. It is
# available as a configuration option in the config file, forcing the kernel
# to think an ethernet card has a different MAC address than it really has.
if [ -n "${MACADDR}" ]; then
ip link set dev ${DEVICE} address ${MACADDR}
fi
if [ -n "${MTU}" ]; then
ip link set dev ${DEVICE} mtu ${MTU}
fi
说明读MACADDR
vi /etc/sysconfig/network-scripts/ifcfg-eth0
把 HWADDR=00:13:20:B2:E6:45 改成 MACADDR=00:11:22:33:44:55 就行。 这样就可以把所MAC地址永久的改了。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/7869/showart_160645.html |
|