Hello together, I am using a dedicated Hetzner Server with one public IP Address.
Using under private IP 10.10.10.200 a LXC Container which I can ping from each remote host outside and from the Container I also can ping 1.1.1.1.
But when I create a VM with debian or ubuntu I am not able to connect to my network. I saw many postings like this one, but there was no answer to find.
auto lo
iface lo inet loopback
iface enp34s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 78.XXX.104.XXX/27
gateway 78.XXX.XXX.97
bridge-ports enp34s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 10.10.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -F
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 10.10.10.200:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.10.10.200:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to 10.10.10.200:443
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8080 -j DNAT --to 10.10.10.100:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 4433 -j DNAT --to 10.10.10.100:443
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2022 -j DNAT --to 10.10.10.100:22
Using under private IP 10.10.10.200 a LXC Container which I can ping from each remote host outside and from the Container I also can ping 1.1.1.1.
But when I create a VM with debian or ubuntu I am not able to connect to my network. I saw many postings like this one, but there was no answer to find.
auto lo
iface lo inet loopback
iface enp34s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 78.XXX.104.XXX/27
gateway 78.XXX.XXX.97
bridge-ports enp34s0
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 10.10.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -F
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 1022 -j DNAT --to 10.10.10.200:22
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 80 -j DNAT --to 10.10.10.200:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 443 -j DNAT --to 10.10.10.200:443
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 8080 -j DNAT --to 10.10.10.100:80
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 4433 -j DNAT --to 10.10.10.100:443
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 2022 -j DNAT --to 10.10.10.100:22