Hi everyone,
I have a dedicated server on Hetzner with only the Primary IP and inside it's running a Minecraft server. I decided to buy a second dedicated server (I haven't bought it yet) for divide the load, but I need to connect the two LXC container locally one from each other. I discovered the vSwitch and I want to know how I have to configure it on proxmox. I need to use the Primary IP for Hosts and LXC container for connect them to the internet, but I need the vSwitch for only connects the two LXC container locally, so I don't need a secondary IP only for container's internet. Right now I have the base configuration, eno1 with the public IP and vmbr0 with 192.168.1.0/24 network.
How can I connect the two LXC container to each other?
I have a dedicated server on Hetzner with only the Primary IP and inside it's running a Minecraft server. I decided to buy a second dedicated server (I haven't bought it yet) for divide the load, but I need to connect the two LXC container locally one from each other. I discovered the vSwitch and I want to know how I have to configure it on proxmox. I need to use the Primary IP for Hosts and LXC container for connect them to the internet, but I need the vSwitch for only connects the two LXC container locally, so I don't need a secondary IP only for container's internet. Right now I have the base configuration, eno1 with the public IP and vmbr0 with 192.168.1.0/24 network.
Code:
auto lo
iface lo inet loopback
iface lo inet6 loopback
auto eno1
iface eno1 inet static
address 176.x.yy.zzz/27
gateway 176.y.zz.xxx
up route add -net 176.z.xx.yyy netmask 255.255.255.224 gw 176.x.zz.yyy dev eno1
iface eno1 inet6 static
address xxx:xxx:xxx:xxxx::x/64
gateway xxxx::x
auto eth0
iface eth0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.1.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 '192.168.1.0/24' -o eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o eno1 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
How can I connect the two LXC container to each other?