From e6aec3744b7ce3d5d70d4ef1ddcfc2a349dfdb8b Mon Sep 17 00:00:00 2001 From: spiritlhl <103393591+spiritLHLS@users.noreply.github.com> Date: Sun, 19 May 2024 11:47:11 +0000 Subject: [PATCH] update --- docs/en/guide/pve/pve_kvm.md | 13 +++++++++++++ docs/guide/pve/pve_kvm.md | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/docs/en/guide/pve/pve_kvm.md b/docs/en/guide/pve/pve_kvm.md index 3b73224210..29a2ad2733 100644 --- a/docs/en/guide/pve/pve_kvm.md +++ b/docs/en/guide/pve/pve_kvm.md @@ -378,6 +378,19 @@ The above command is used to create a virtual machine with an independent IPV4 a | IPV6 | None | | MAC_ADDRESS | None | +## Incoming and outgoing traffic goes to the bound IPV4 address + +execute + +``` +line="-A POSTROUTING -s 172.16.1.0/24 -o vmbr0 -j MASQUERADE" +sed -i "/$line/d" /etc/iptables/rules.v4 +service netfilter-persistent restart +``` + +This will cause the host to lose the ability to open VMs/containers with NAT that do not have a separate IPV4 address, so be careful! + +After this, You will only be able to open VMs with separate IPV4 addresses. ## Creating Virtual Machines with Pure IPv6 Addresses diff --git a/docs/guide/pve/pve_kvm.md b/docs/guide/pve/pve_kvm.md index 0854043d14..dacdcd56df 100644 --- a/docs/guide/pve/pve_kvm.md +++ b/docs/guide/pve/pve_kvm.md @@ -432,6 +432,20 @@ curl -L https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt | IPV4地址 | a.b.c.d | | IPV6 | 无 | +## 进出流量都走绑定的IPV4地址 + +执行 + +``` +line="-A POSTROUTING -s 172.16.1.0/24 -o vmbr0 -j MASQUERADE" +sed -i "/$line/d" /etc/iptables/rules.v4 +service netfilter-persistent restart +``` + +即可,但这会导致宿主机丧失开设非独立IPV4地址的NAT的虚拟机/容器的能力,慎重执行 + +执行后你只能开设独立IPV4地址的虚拟机了。 + ## 开设纯IPV6地址的虚拟机 前提是宿主机给的是IPV6子网而不是单独一个IPV6地址,且宿主机未开启MAC地址校验