centos7
图形设置
yum install NetworkManager-tui #centos7 nmtui edit eth0 #图形设置ip systemctl restart network.service ip add li
配置文件设置
vim /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.15.20 NETMASK=255.255.255.0 GATEWAY=192.168.15.254 DNS1=192.168.20.20 vim /etc/sysconfig/network #网关配置方法2 GATEWAY=192.168.15.254 vim /etc/resolv.conf #dns配置方法2 nameserver 10.0.0.51
centos7修改网卡命名
安装系统后
vim /etc/sysconfig/grub 加入 biosdevname=0 net.ifnames=0 grub2-mkconfig -o /boot/grub2/grub.cfg #更新配置
安装系统前
点击 Tab,打开kernel启动选项
增加内核参数: net.ifnames=0 biosdevname=0