查看原有的设备名称为veth1
[root@centos7 ~]# ip netns exec ns1 ip link 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 5: veth1@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether 42:54:6d:73:c2:40 brd ff:ff:ff:ff:ff:ff link-netnsid 0
关闭网卡,否则修改报设备忙
[root@centos7 ~]# ip netns exec ns1 ip link set dev veth1 down [root@centos7 ~]#
修改设备的名字
[root@centos7 ~]# ip netns exec ns1 ip link set dev veth1 name eth0
启动网卡
[root@centos7 ~]# ip netns exec ns1 ip link set dev eth0 up
查看最新的网卡的名字,已经修改为eth0了
[root@centos7 ~]# ip netns exec ns1 ip link 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 5: eth0@if6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000 link/ether 42:54:6d:73:c2:40 brd ff:ff:ff:ff:ff:ff link-netnsid 0 [root@centos7 ~]#
标签:00,端点,ip,veth,centos7,link,ff,linux,root From: https://www.cnblogs.com/chuanzhang053/p/17593072.html