确定物理网口对应的名称以及配置静态IP
文章目录
确定物理网口对应的名称
在一台ubuntu的机器上,有四个物理网口,我想知道每个网口对应的MAC地址。使用ip a可以看到网口的MAC地址和名称,比如列出了ens1f0, ens1f1, ens4f0, ens4f1。 原来的网卡interface都是eth开头,后来改成了enp, ens等。
Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1) Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1) Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0) Names incorporating the interfaces’s MAC address (example: enx78e7d1ea46da) Classic, unpredictable kernel-native ethX naming (example: eth0)
那么如何确定机器上的ens1f0对应的哪个物理网口呢,可以用ethtool来实现,ethtool是用于查询及设置网卡参数的命令。用ethtool -p enos1f1,看哪个网口在闪灯,就能确定这个物理网口对应的名称。记得不要插网线。
|
|
如果没有一个网口亮灯,很可能是因为网口不支持,则可以尝试ethtool -t enosf1f1,大概在4秒之后,网口的灯会亮,这个时候就可以确定enos1f1对应的具体的物理网口了。
|
|
很简单的一个命令,知道了就很简单,不知道就很难想到。
配置静态IP
|
|
配置好了之后,生效
|
|
#####################################################################
#版权所有 转载请告知 版权归作者所有 如有侵权 一经发现 必将追究其法律责任
#Author: Jason
#####################################################################
文章作者 zzx
上次更新 2020-08-26