Hi, I'm hosting Proxmox at Hetzner, which gives me a Proxmox instance behind a public IP. I managed to get proxmox to have an internet connection with the following /etc/network/interfaces config. And vmbr1 and the #nat is my attempt to get it to work for VM's.
But I'm at a loss on how to get my VM's and LXC's to get an internet connection. I'm not much of a Linux man when it comes to networking. My end goal is hosting websites on the LXC's and maybe the VM's. So they'd have to share the same public IP my Proxmox host has. I know how to set it up in Nginx once I have a public IP for my containers/vm's so any help with getting that would be appreciated.
Code:
auto lo
iface lo inet loopback
iface ens3 inet manual
iface enp0s31f6 inet manual
auto vmbr0
iface vmbr0 inet static
address <<publicIPV4>>
gateway <<publicIPV4gateway>>
bridge-ports enp0s31f6
bridge-stp off
bridge-fd 0
auto vmbr1
iface vmbr1 inet static
address 192.168.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
#NAT
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.10.0/24' -o vmbr0 -j MASQUERADE
But I'm at a loss on how to get my VM's and LXC's to get an internet connection. I'm not much of a Linux man when it comes to networking. My end goal is hosting websites on the LXC's and maybe the VM's. So they'd have to share the same public IP my Proxmox host has. I know how to set it up in Nginx once I have a public IP for my containers/vm's so any help with getting that would be appreciated.
Last edited: