pve icon indicating copy to clipboard operation
pve copied to clipboard

(实则因为本项目嵌套本项目开设的问题,非嵌套本项目应该无问题) 宿主机:debian12 安装PVE,宿主机重启网络后虚拟机的tap设备丢失无法自创建和链接,需要虚拟机本身关机重启解决/使用OVS替代网桥实现NAT

Open spiritLHLS opened this issue 1 year ago • 33 comments

debian12系统安装了虚拟化项目,开设的nat kvm虚拟机 运行使用一段时间会断网,从pev控制台进入nat kvm虚拟机 ping 172.16.1.1 也不通,执行reboot重启也不通,是所有的nat kvm 虚拟机同时出现不通,只能在pve web控制台点击虚拟机然后再点右上方的关闭菜单机选择等待重启重启后虚拟机网络可以恢复,但是这个没网络时不会出现,不知道是哪里的问题。debian12 主机自身网络正常。

auto lo
iface lo inet loopback
auto vmbr0
iface vmbr0 inet static
    address 110.xx.xx.xx/24
    gateway 110.xx.xx.1
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0

iface vmbr0 inet6 static
    address 240e:x:x:x::x:x/128
    gateway 240e:x:x:x::5064:1
    up ip addr del fe80::be24:11ff:feb6:c5c2/64 dev eth0
auto vmbr1
iface vmbr1 inet static
    address 172.16.1.1
    netmask 255.255.255.0
    bridge_ports none
    bridge_stp off
    bridge_fd 0
    post-up echo 1 > /proc/sys/net/ipv4/ip_forward
    post-up echo 1 > /proc/sys/net/ipv4/conf/vmbr1/proxy_arp
    post-up iptables -t nat -A POSTROUTING -s '172.16.1.0/24' -o vmbr0 -j MASQUERADE
    post-down iptables -t nat -D POSTROUTING -s '172.16.1.0/24' -o vmbr0 -j MASQUERADE

iface vmbr1 inet6 static
    address 2001:db8:1::1/64
    post-up sysctl -w net.ipv6.conf.all.forwarding=1
    post-up ip6tables -t nat -A POSTROUTING -s 2001:db8:1::/64 -o vmbr0 -j MASQUERADE
    post-down sysctl -w net.ipv6.conf.all.forwarding=0
    post-down ip6tables -t nat -D POSTROUTING -s 2001:db8:1::/64 -o vmbr0 -j MASQUERADE

Originally posted by @wbews in https://github.com/oneclickvirt/pve/issues/11#issuecomment-2303819464

spiritLHLS avatar Aug 22 '24 05:08 spiritLHLS