zl程序教程

您现在的位置是:首页 >  其他

当前栏目

linux环境下修改网卡为eth0

2023-02-18 15:49:39 时间
如果没有在安装系统之前传递内核参数将⽹卡名称更改为eth*,则可以在安装系统后修改

vim /etc/default/grub

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=2
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

# update-grub
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.15.0-55-generic
Found initrd image: /boot/initrd.img-4.15.0-55-generic
done

Ubuntu server还需修改
vim /etc/netplan/
01-netcfg.yaml


#reboot
重启后生效