修改mac
时间:2006-08-25 来源:huanghaojie
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地址永久的改了。
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地址永久的改了。
相关阅读 更多 +