diff options
Diffstat (limited to 'remote/modules/vmchooser/data/opt')
-rwxr-xr-x | remote/modules/vmchooser/data/opt/openslx/iptables/rules.d/50-virt-nat1-masquerading | 3 | ||||
-rwxr-xr-x | remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/remote/modules/vmchooser/data/opt/openslx/iptables/rules.d/50-virt-nat1-masquerading b/remote/modules/vmchooser/data/opt/openslx/iptables/rules.d/50-virt-nat1-masquerading new file mode 100755 index 00000000..b0909760 --- /dev/null +++ b/remote/modules/vmchooser/data/opt/openslx/iptables/rules.d/50-virt-nat1-masquerading @@ -0,0 +1,3 @@ +#!/bin/ash + +iptables -t nat -A POSTROUTING -o br0 -s 192.168.101.0/24 -j MASQUERADE diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env b/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env index 3358a85f..04ea4b0d 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env @@ -150,12 +150,15 @@ done # kvmnet2* for Qemu/KVM # creating and configuring nat0 +# 192.168.101.0/24 is vm nat. If you ever change this there are a couple of other files +# where you'd need to make changes, so think twice before doing so. ;) brctl addbr nat1 ip link set dev nat1 up ip addr add 192.168.101.1/24 dev nat1 echo "1" >/proc/sys/net/ipv4/conf/nat1/forwarding echo "1" >/proc/sys/net/ipv4/conf/br0/forwarding 2>/dev/null -iptables -t nat -A POSTROUTING -o br0 -s 192.168.0.0/16 -j MASQUERADE +# iptables masquerade rule is now inserted by /opt/openslx/iptables/rules.d/50-virt-nat1-masquerading +### iptables -t nat -A POSTROUTING -o br0 -s 192.168.0.0/16 -j MASQUERADE for wait in 1 1 2 2 3 end; do grep '^SLX_DNS' "/opt/openslx/config" > /dev/null && break |