OPNsense Forum

English Forums => High availability => Topic started by: raspbeguy on October 20, 2022, 02:59:46 PM

Title: Gateway to master instance makes backup instance unreachable on LAN
Post by: raspbeguy on October 20, 2022, 02:59:46 PM
Hello,
I'm pretty new with OPNsense/freeBSD. I have to OPNsense instances in master/backup setup.
Both instances LAN interfaces are configured in a CARP: 192.168.0.1/24

Currently mulder is backup and scully is master.
To enable mulder able to access WAN, I set up a Gateway in System > Gateways
(https://forum.opnsense.org/index.php?action=dlattach;topic=30751.0;attach=24004;image)
Then I set this gateway as IPv4 Upstream Gateway in Interfaces > [LAN]
(https://forum.opnsense.org/index.php?action=dlattach;topic=30751.0;attach=24006;image)

As a result, the backup instance has access to the internet but is now unreachable from my LAN devices: whenever it receives a TCP or ICMP package, it wants to respond through the configured gateway. To make those screen capture I had to connect through another interface.

Am I missing something?
Title: Re: Gateway to master instance makes backup instance unreachable on LAN
Post by: Patrick M. Hausen on October 20, 2022, 03:11:50 PM
You need a fixed IP address on WAN for each of the notes both pointing to the regular default gateway, and a floating (CARP/VIP) IP address on WAN that is active on whichever node is the master.

This way both nodes have Internet access.
Title: Re: Gateway to master instance makes backup instance unreachable on LAN
Post by: raspbeguy on October 20, 2022, 03:19:07 PM
Well, this isn't possible here. WAN side is managed by DHCP so only one possible IP. There is already a topic for that (https://forum.opnsense.org/index.php?topic=20972.0) but that's another problem
Title: Re: Gateway to master instance makes backup instance unreachable on LAN
Post by: Patrick M. Hausen on October 20, 2022, 03:22:02 PM
Well, what I told you is how the setup and protocol is supposed to work. If you only have a single uplink with a single IP address via DHCP, what's the point having a HA setup, anyway?

Of course you can try to hack until it sort of works. Unfortunately I cannot help with that.
Title: Re: Gateway to master instance makes backup instance unreachable on LAN
Post by: raspbeguy on October 20, 2022, 03:27:10 PM
Of course, it would make more sense to have two separate physical links to connect to the WAN. But it still makes sense to set up HA even in this configuration, for example when upgrading the instances without downtime, and of course educational purpose and having fun (maybe I should have made it clear that this isn't a production setup, only my homelab).