当前位置 博文首页 > LuciferLiu_DBA:redhat7安装后修改网卡配置(nmcli)
[root@localhost ~]# nmcli connection show?
NAME ?UUID ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?TYPE ? ? ?DEVICE?
ens224 ?ed8c24af-32ce-41d4-9cb0-50457f650009 ?ethernet ?ens224 ??
ens256 ?b060629f-f32e-4b8e-982e-529e97643d81 ?ethernet ?ens256
[root@localhost ~]# nmcli connection add con-name eth0 ifname ens224 type ethernet
[root@localhost ~]# nmcli connection add con-name eth1 ifname ens256 type ethernet
[root@localhost ~]# nmcli connection down ens224
[root@localhost ~]# nmcli connection down ens256
[root@localhost ~]# nmcli connection delete ens224
[root@localhost ~]# nmcli connection delete ens256
[root@localhost ~]# ip link show
eth0:00:0c:29:ee:90:77
eth1:00:0c:29:ee:90:81
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=00:0c:29:ee:90:7
DEVICE=eth0
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth1
HWADDR=00:0c:29:ee:90:81
DEVICE=eth1
[root@localhost ~]# ip link set ens224 down
[root@localhost ~]# ip link set ens256 down
[root@localhost ~]# ip link set ens224 name eth0
[root@localhost ~]# ip link set ens256 name eth1
[root@localhost ~]# ip link set eth0 up
[root@localhost ~]# ip link set eth1 up
[root@localhost ~]# nmcli connection up eth0
[root@localhost ~]# nmcli connection up eth1
[root@localhost ~]# nmcli connection reload?
[root@localhost ~]# systemctl restart network.service
[root@localhost ~]# nmcli connection show?
NAME ?UUID ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?TYPE ? ? ?DEVICE?
eth0 ?e5966e4d-fa43-4e0c-8962-5403ca1c88eb ?ethernet ?eth0 ??
eth1 ?0d1a07f5-a52f-4b38-b02f-405b0e3e32ac ?ethernet ?eth1?
?