当你在A机器上安装好了pve系统,现在想直接把A机器的pve系统硬盘换到B机器上,那么由于B机器的网口和A不一样,导致启动之后没有网络
解决方法
通过ip addr show查看当前机器的网口端口,下面命令可以看到当前使用的是enp6s0
root@pve2:~# ip addr show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master vmbr0 state UP group default qlen 1000 link/ether 00:a7:b5:68:23:c4 brd ff:ff:ff:ff:ff:ff 3: vmbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether 00:a7:b5:68:23:c4 brd ff:ff:ff:ff:ff:ff inet 192.168.0.254/24 scope global vmbr0 valid_lft forever preferred_lft forever inet6 fe80::2a7:b5ff:fe68:23c4/64 scope link valid_lft forever preferred_lft forever
修改interface,把enp7s0修改成enp6s0
root@pve2:~# cat /etc/network/interfaces auto lo iface lo inet loopback iface enp7s0 inet manual auto vmbr0 iface vmbr0 inet static address 192.168.0.254/24 gateway 192.168.0.1 bridge-ports enp7s0 bridge-stp off bridge-fd 0 iface enp6s0 inet manual
重启网络
systemctl restart networking
原创文章,作者:站长,如若转载,请注明出处:https://wsppx.cn/2618/%e7%bd%91%e7%ab%99%e9%83%a8%e7%bd%b2/