klinux网卡绑定成trunk,mac地址怎么区分

哦,当时我对修改Linux系统的MAC地址很困惑。
Okay, let's talk about this in detail.
First of all, if you want to temporarily change the MAC address to, for example, 0004 a2 d2 e2 1 2 , you need to stop the network card first and use ifconfig eth0 down.否则系统会太忙而无法更改。
然后使用 ifconfig eth0 hw ether 0004 a2 d2 e2 1 2 此后,网卡将被替换为新的 MAC 地址。
However, this method has a drawback.重新启动计算机,它将恢复到原始状态。

如果你想永远改变这一点,你就必须动动你的大脑。
您需要在 Linux 系统启动脚本中添加几行代码。
您可以将其添加到 /etc/rc.d/rc.local 或 /etc/init.d/network 中。
特别是:
ifconfig eth0 已禁用 ifconfig eth0 hw ether 0004 a2 d2 e2 1 2 ifconfig eth0 up
此后,重启后MAC地址将保持稳定。

Finally, how to check?重新启动计算机并在终端中输入 IPconfig /all 以检查物理地址是否与您需要的地址匹配。
If yes, then it is a success.我尝试的时候就按照这个方法做了,后来发现还蛮简单的。

查看网卡mac地址命令查看网卡linux

使用直接ip链接检查网卡状态。

ip link 列出所有网卡和状态。

ip addr 列出网卡的IP 地址。

ethtool -i eth0 查看网卡驱动及详细信息。

dmesg | grep eth0 启动时查看网卡信息。

ifconfig 将其用于较旧的系统。

watch -n 1 ip link 实时查看网卡状态。

要禁用网卡,请使用systemctl disable eth0。

要启用网卡,请使用systemctl enable eth0。

Permanently disable editing /etc/sysconfig/network-scripts/ifcfg-eth0, set ONBOOT=no.
称一下体重。