如何在 Ubuntu 16.04 LTS 上将网络适配器名称从 enp1s0f0 更改为 eno1

如何在 Ubuntu 16.04 LTS 上将网络适配器名称从 enp1s0f0 更改为 eno1
Root@shrack309683c:~# ifconfig
enp1s0f0  Link encap:Ethernet  HWaddr 00:25:90:c7:4e:ba  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Memory:fbb20000-fbb3ffff 

enp1s0f1  Link encap:Ethernet  HWaddr 00:25:90:c7:4e:bb  
          inet addr:10.1.37.230  Bcast:10.1.37.255  Mask:255.255.254.0
          inet6 addr: fe80::cbaa:cde2:32:6a10/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8022 errors:0 dropped:0 overruns:0 frame:0
          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:764295 (764.2 KB)  TX bytes:24870 (24.8 KB)
          Memory:fbb00000-fbb1ffff 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:892 errors:0 dropped:0 overruns:0 frame:0
          TX packets:892 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:66458 (66.4 KB)  TX bytes:66458 (66.4 KB)

答案1

ip命令可以做到这一点:

sudo ip link set enp1s0f0 down
sudo ip link set enp1s0f0 name eno1
sudo ip link set eno1 up

相关内容