101: Setup NAT with a single interface

Started by wedibit, June 03, 2020, 06:12:05 PM

Previous topic - Next topic
Hi,
I have a machine with a single interface. This interface has a private IP and two public IPs. In the end, I would like OPNsense to act as default gateway for all machines inside the private network with automatic gateway failover if one is not available. Unfortunately, I don't even get it to work with a single gateway.

This is the way I went (with quite a few detours, the learning curve for beginners is quite steep when you have just one interface available):
I assigned my interface to LAN and set one of the public IPs and the corresponding gateway. This made me reach the web interface, a great start. Next, I disabled the (cable-/useless) WAN interface and I added the private IP as an IP alias to the LAN interface and an outbound NAT (source: the internal subnet, destination: not internal subnet). As this did not work, I added a firewall rule that allows everything to make sure I got the NAT thing right but I had no luck. I can see the default route pointing to the gateway.

It would be great to get a pointer in the right direction.

Ooops. I just wondered where my post is. It went into the wrong place. Sorry, mods. Please move it.