实验-禁用网卡命名规则:
在GRUB_CMDLINE_Linux=“rd.lvm.lv=rhel/root vconsole.keymap=us vconsole.font=latarcyheb-sunl6 crashkernel=auto rhgb quiet net.ifnames=0 bios sdevname=0"行尾的引号内部加入 net.ifnames=0 biosdevname=0 参数
grub2-mkconfig - o /boot/grub2/grub.cfg
重启后系统将不采用网卡命名规则而是采用原RHEL6的命名规则
实验临时修改IP:
ifconfig eno16777736 100.100.100.100/16
ifconfig
nmcli connection down eno16777736;nmcli connection up eno16777736
ifconfig
实验-修改网络参数官方推荐版:
nmcli connection modify eno167.. ipv4.method manual ipv4.addresses "192.168.100.1/24 192.168.100.1" ipv4.dns 192.168.100.1 connection.autoconnect yes
nmcli connection modify eno167.. +ipv4.addresses 10.0.0.1/8
nmcli connection down eno1677.. ;nmcli connection up eno1677..
实验添加IPV6的地址:
nmcli connection modify eno167.. ipv6.method manual ipv6.addresses '2001::1/64 2001::1 ' ipv6.dns 2001::1
nmcli connection down eno1677.. ;nmcli connection up eno1677..
ping6 2001::1
实验-多配置文件管理网卡:
nmcli connection add type ethernet con-name home ifname eno 1677..
nmcli connection modify home ipv4.method manual ipv4.addresses "10.0.0.1/24 10.0.0.1" ipv4.dns 10.0.0.1
nmcli connection down eno1677..
nmcli connection up home
查看地址已经更改
实验-单配置文件增加::信息
vim /etc/sysconfig/network-scripts/ifcfg-eno16...
IPADDR1=10.0.0.1
PREFIX1=8
GATEWAY1=10.0.0.1
DNS2=10.0.0.1
systemctl restart NetworkManager
ip addr show
实验-新增网卡
新添加一块网卡
nmcli device show 可以发现新增了一块网卡
nmcli connection add type ethernet en0.... ifname eno....
nmcli connection modify en0.... ipv4.method manual ipv4.addresses "192.168.100.1/24 192.168.100.1" ipv4.dns 192.168.100.1 connection.autoconnect yes
systemctl restart NetworkManager
ifconfig