OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: Damnati on March 02, 2023, 04:24:34 PM

Title: *Newby* How to Configure two Separate WAN and LAN connection ?
Post by: Damnati on March 02, 2023, 04:24:34 PM
Hello,

I want to set up WAN 1 on Port 0 with LAN 1 on Port 1, and keep them separate from WAN 2 on Port 2, which should supply LAN 2 on Port 3.

For example:

WAN_Office:
IP: 222.6.180.170
Sub: 255.255.255.254
Gateway: 222.6.180.180
DNS:222.6.180.179

LAN_Office:
IP: 172.16.134.1
Sub: 255.255.254.0

WAN_Production:
IP: 222.6.180.171
Sub: 255.255.255.254
Gateway: 222.6.180.181
DNS:222.6.180.178

LAN_Production:
IP: 172.17.134.1
Sub: 255.255.254.0

I need to statically set the IP, subnet, gateway, and DNS settings for the WAN adapter, and then assign it to a specific LAN adapter.

Is there any way to configure it in this manner? I'm new to hardware, so any help would be appreciated.

Thank you in advance.

Best regards,
Damnati
Title: Re: *Newby* How to Configure two Separate WAN and LAN connection ?
Post by: Patrick M. Hausen on March 02, 2023, 05:26:04 PM
There is no "assigning" of LAN to WAN interfaces. But you can have multiple WAN interfaces - just configure them as necessary for the type of connection in question. Then each of those will also have some gateway, right?

Then you can set up two LAN interfaces, assign addresses, configure DHCP etc. and then ... change the "allow all" rule that comes as a default with OPNsense to use a single specific gateway.

That way traffic from LAN 1 will go out WAN 1 through the WAN 1 gateway and traffic from LAN 2 will go out WAN 2 through the WAN 2 gateway.

HTH
Patrick
Title: Re: *Newby* How to Configure two Separate WAN and LAN connection ?
Post by: Amr on March 08, 2023, 12:39:04 PM
QuoteI need to statically set the IP, subnet, gateway, and DNS settings for the WAN adapter,
you can set the static IP in the and the gateway in [Interfaces] (gateways can also be configured in [System: Gateways: Single]), DNS is under System: Settings: General.
Quoteand then assign it to a specific LAN adapter.
PS:  You should have posted that in general discussion ;), make sure to post in the right forum to have a higher chance of people responding to you.