文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>关于MAC地址

关于MAC地址

时间:2006-08-21  来源:wxgchinaunix

若是你是使用 RHEL 这类版本的话,请考虑先看一下 /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


可以发现到目前都是流行使用 ip 程式,已经逐渐不使用 ifconfig 程式了。

而你网路卡配置 /etc/sysconfig/network-scripts/ifcfg-eth0 应该就会使用像是:


DEVICE=eth0
IPADDR=192.168.1.1
NETMASK=255.255.255.0
MACADDR=00:11:22:33:44:55


其中 MACADDR 应该就是你预期要改的的项目。把预期的网路卡卡号放进去就可以。

改好执行 /etc/init.d/network stop ; /etc/init.d/network start

若是您是使用 SUSE Linux 的话,SuSE 本身就已经给您一个很明确清楚的样板档案,档案名称为 /etc/sysconfig/network/ifcfg.template,该档案里面有提到配置说明。

比方你目前使用中的网路卡的 mac addr 是  00:11:22:33:44:55,那您的系统应该就会有 /etc/sysconfig/network/ifcfg-eth-id-00:11:22:33:44:55 档案,该档案内容会像是:


IPADDR=192.168.1.1
NETMASK=255.255.255.0


你要换网路卡卡号的话,就是多 LLADDR 该叙述。

IPADDR=192.168.1.1
NETMASK=255.255.255.0
LLADDR=00:48:54:11:22:33


改好后执行 rcnetwork stop ; rcnetwork start 应该就可以了 (用 ifup/ifdown 也可以)。

另外补充的是,使用 ip 程式配置网路介面 mac 组态的话,该配置设定实际底层会是:

ip link set eth0 address 00:48:54:11:22:33
相关阅读 更多 +
排行榜 更多 +
末日枪战精英手机版

末日枪战精英手机版

飞行射击 下载
末日模拟生存最新版

末日模拟生存最新版

飞行射击 下载
末日求生枪战安卓版

末日求生枪战安卓版

飞行射击 下载