一、修改网卡名称为eth
1、方法一(在安装系统时修改):
# 进入启动菜单后按Tab键,在quiet后添加net.ifnames=0 biosdevname=0 > vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet net.ifnames=0 biosdevname=0
2、方法二(安装完系统修改)
[root@Rocky9 ~]# cat /etc/default/grub
GRUB_TIMEOUT=5 GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" GRUB_DEFAULT=saved GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="resume=UUID=399b90b6-59a3-4416-b248-3edfc297c32f biosdevname=0 net.ifnames=0 rhgb quiet" GRUB_DISABLE_RECOVERY="true" GRUB_ENABLE_BLSCFG=true
[root@Rocky9 ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
[root@Rocky9 ~]# reboot
二、网卡配置
[root@Rocky9 ~]# cat /etc/NetworkManager/system-connections/eth0.nmconnection
[connection] id=eth0 uuid=6a889213-92c6-31b0-b7aa-eece085cf3e1 type=ethernet autoconnect-priority=-999 interface-name=eth0 timestamp=1680771969 [ipv4] address1=192.168.247.130/24,192.168.247.2 # IP,Gateway dns=114.114.114.114;8.8.8.8; method=manual route1=10.10.10.0/24,192.168.247.2,80 # Destination,Nexthop,Metric route2=10.10.20.0/24,192.168.247.2,90
[root@Rocky9 ~]# nmcli con down eth0 && nmcli con up eth0
标签:24,Rocky,GRUB,优化,192.168,Linux,Rocky9,root,eth0 From: https://www.cnblogs.com/xwupiaomiao/p/18324627