ubuntu修改网口名称

ubuntu修改网口名称

root@gb:~# 1 sudo nano /etc/default/grub 
# 找到GRUB_CMDLINE_LINUX=""
# 改为GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"
root@gb:~# sudo grub-mkconfig -o /boot/grub/grub.cfg

root@gb:~# ifconfig 
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.60.59  netmask 255.255.255.0  broadcast 192.168.60.255
        inet6 fe80::76fe:48ff:fe8a:b564  prefixlen 64  scopeid 0x20<link>
        ether 74:fe:48:8a:b5:64  txqueuelen 1000  (Ethernet)
        RX packets 6431  bytes 782651 (782.6 KB)
        RX errors 0  dropped 3597  overruns 0  frame 0
        TX packets 818  bytes 157078 (157.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xfea00000-fea7ffff  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 226  bytes 15920 (15.9 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 226  bytes 15920 (15.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

root@gb:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 74:fe:48:8a:b5:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.60.59/24 brd 192.168.60.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::76fe:48ff:fe8a:b564/64 scope link 
       valid_lft forever preferred_lft forever
root@gb:~# 

参考文献:

ubuntu 18.04 enp8s0更改网口名称为eth0

你可能感兴趣的:(Ubuntu,ubuntu,linux,运维,服务器)