2 lan to 1 wan

Started by janne, July 17, 2020, 11:13:26 AM

Previous topic - Next topic
Hi.

Have searched but not found how to configure two different lan to a wan connection. I also have a gateway group for failover.
Someone who has a solution, I would be grateful.  ;)

/Janne

Do you mean two WAN to one LAN?


With a single WAN there is only one gateway.
OPNsense 25.7a - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Hi.
No I mean two LANs (em0 and em3) to one WAN (em1)

Then you do not need a gateway group.


One WAN = One gateway
OPNsense 25.7a - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Well the OP uses gateway group for failover.

What I think the OP is after, is how to get the two LANs to act like ONE LAN, and both use the gateway group for internet access, and I would have to guess that LAN1 to LAN2 and LAN2 to LAN1 access?

There is no 'failover'. what's it going to 'failover' to? There is no gateway group as you can only add one gateway. Delete the group you do not need it  If the WAN is dhcp4 or PPPoE then it's automatic, a gateway will be created automatically, the same applies for dhcp6.


It's simple. Single WAN, single LAN, get that working. Once you have one LAN working add another LAN, making sure you have set up the appropriate dhcp server settings for each LAN; check that devices on both LANs can see the internet. Once you have that if you want to be able to talk between the LANs, then add rules on the LANs to allow access.
OPNsense 25.7a - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

Well that is of course 100% tru - however I am not aware if WAN is just one or more interfaces.

For example, I have interfaces WAN (gateway WAN_DHCP) and WANBACKUP (gateway WANBACKUP_DHCP) - and the WANGWGROUP group gateway to support failover. However I might call this group gateway "WAN" just as well instead of the long name (and of course rename my interface to maybe WAN_DEFAULT" and so on).

My idea is that the name says nothing about what underneath.

Quote from: janne on July 22, 2020, 01:20:47 PM
Hi.
No I mean two LANs (em0 and em3) to one WAN (em1)

Hi @Janne

Welcome to the forum!

Judging from the way you asked your question I would presume you are very new to networking. You should probably read up on some routing and switching principles since you seem to be very interested in that.

Now the functionality that you are looking for is explained here >> https://docs.opnsense.org/manual/nat.html#outbound
opnSense does howeve manage this by default so as long as your lan segments (subnets) are properly configured you're g2g.

Basically you can have multiple lan segments share the same outbound gateway or even multiple gateways (gw groups). You will also be able to Layer3 route packets from lan segment a to lan segment b.

Hope this helps to steer you in the right direction. Good luck and reach out when you need a hand!

Quote from: lar.hed on July 23, 2020, 12:20:06 PM
Well that is of course 100% tru - however I am not aware if WAN is just one or more interfaces.

For example, I have interfaces WAN (gateway WAN_DHCP) and WANBACKUP (gateway WANBACKUP_DHCP) - and the WANGWGROUP group gateway to support failover. However I might call this group gateway "WAN" just as well instead of the long name (and of course rename my interface to maybe WAN_DEFAULT" and so on).

My idea is that the name says nothing about what underneath.


Read the OP message. He says he has one wan: em1
OPNsense 25.7a - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member