Two physical proxmox servers and interconect all vms

Jan 22, 2024
5
0
1
Good evening, I am interested in being able to connect two Proxmox servers to each other and that the VMs of both can be seen no matter where they are. The idea is that they work as if they were connected under the same switch, but the problem is that they are connected P2P.
Both nodes are seen via eno1.

I am interested in whether the 192.168.10.X network of both nodes can be one.

How can I do this?



This is my configuration:

Node 1
Bash:
auto lo
iface lo inet loopback

iface enp1s0 inet manual

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address xxx.43.xxx.110/30
        gateway xxx.43.xxx.xxx
        bridge-ports enp1s0
        bridge-stp off
        bridge-fd 0
        bridge-vlan-aware yes
        bridge-vids 2-4049
#IP Public

auto vmbr2
iface vmbr2 inet static
        address 192.168.20.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.20.0/24' -o vmbr1 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.20.0/24' -o vmbr1 -j MASQUERADE
#Intranet

auto vmbr1
iface vmbr1 inet static
        address 192.168.10.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        post-up iptables -t nat -A POSTROUTING -s '192.168.10.1/24' -o vmbr0 -j SNAT --to-source xxx.43.xxx.110
        post-down iptables -t nat -D POSTROUTING -s '192.168.10.1/24' -o vmbr0 -j SNAT --to-source xxx.43.xxx.110
        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
        post-up iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
        post-down iptables -D FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
        post-up iptables -t nat -A POSTROUTING -o vmbr0 -j SNAT --to-source 179.43.118.110
        post-down iptables -t nat -D POSTROUTING -o vmbr0 -j SNAT --to-source 179.43.118.110
        ip-forward on
#Internet
Node 2
Bash:
auto lo
iface lo inet loopback

iface enp2s0 inet manual

iface eno1 inet manual

auto vmbr0
iface vmbr0 inet static
        address XXX.58.XXX.218/30
        gateway XXX.58.XXX.xxx
        bridge-ports enp2s0
        bridge-stp off
        bridge-fd 0
#IP Public

auto vmbr1
iface vmbr1 inet static
        address 192.168.10.1/24
        bridge-ports none
        bridge-stp off
        bridge-fd 0
        post-up iptables -t nat -A POSTROUTING -s '192.168.10.1/24' -o vmbr0 -j SNAT --to-source XXX.58.XXX.218
        post-down iptables -t nat -D POSTROUTING -s '192.168.10.1/24' -o vmbr0 -j SNAT --to-source XXX.58.XXX.218
        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
        post-up iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
        post-down iptables -D FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
        post-up iptables -t nat -A POSTROUTING -o vmbr0 -j SNAT --to-source 200.58.108.218
        post-down iptables -t nat -D POSTROUTING -o vmbr0 -j SNAT --to-source 200.58.108.218
        ip-forward on
#Internet

auto vmbr2
iface vmbr2 inet static
        address 192.168.20.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.20.0/24' -o vmbr2 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '192.168.20.0/24' -o vmbr2 -j MASQUERADE
#Internet

auto vmbr3
iface vmbr3 inet static
        address 10.88.8.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.88.8.0/24' -o vmbr3 -j MASQUERADE
        post-down iptables -t nat -D POSTROUTING -s '10.88.8.0/24' -o vmbr3 -j MASQUERADE
#Intranet App1
 
Hi,

This is not a proxmox VE related question.

You just need to follow the network standarda and all gonna be good themselve.

OR, you wanna create a cluster between yours proxmox, and then another kind of solution are available IF you have good hardware material between them
 
I'm not network expert.. but adding eno1 to bridge-ports of vmbr2 on each node + changing ip of vmbr2 on node2 to 20.2, then it could work. (on the paper of my head)
 
Last edited:
Bro.... you cannot have the same IP on your 10.0/24 network on yours two nodea. Cfg, on the same network, node2 in exemple 10.3/24(or whatever you want, but free ip )

And it s gonna work
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!