OPNsense Forum

Archive => 19.1 Legacy Series => Topic started by: 555|STi on September 05, 2019, 08:36:41 pm

Title: 2 NIC with same GW
Post by: 555|STi on September 05, 2019, 08:36:41 pm
Hi there. I need some help from you, guys.

Currently I have a server with 4 NICs.


I need to assign the same GW to NIC 3 and 4. The IPs are different only on the last octet. The IP assigned to the 4th interface is enabled to access a remote server, but the 3rd is the interface of the incoming connections, none of these can be changed.

How can I achieve this?

Thanks in advance!
Title: Re: 2 NIC with same GW
Post by: tong2x on September 06, 2019, 02:07:20 am
when you say it is for remote access... is it really a WAN?
Title: Re: 2 NIC with same GW
Post by: 555|STi on September 06, 2019, 05:31:55 am
L
when you say it is for remote access... is it really a WAN?

Yes, it is a WAN.

LAN
WAN1 - INTERNET PROVIDER 1 - AAA.BBB.CCC.DDD
WAN2 - INTERNET PROVIDER 2 - XXX.YYY.ZZZ.123
WAN3 - INTERNET PROVIDER 2 - XXX.YYY.ZZZ.124

Thanks in advance.
Title: Re: 2 NIC with same GW
Post by: mimugmail on September 06, 2019, 05:48:26 am
This cant work as gateways are bound to interfaces.
Title: Re: 2 NIC with same GW
Post by: ruffy91 on September 06, 2019, 07:03:11 am
You can add the 2nd IP as an Alias IP to WAN2.
Then you can use outbound NAT to send the packets out the right IP.
Title: Re: 2 NIC with same GW
Post by: 555|STi on September 07, 2019, 10:59:22 pm
You can add the 2nd IP as an Alias IP to WAN2.
Then you can use outbound NAT to send the packets out the right IP.
Interesting! I'll try this!
Thank you!

This cant work as gateways are bound to interfaces.
Yeah, I was thinking the same, thank you!

I was in a hurry to make it work so finally I "cheated"... The solution I implemented was to use a router before the NIC.

Code: [Select]
ISP2 -> WAN2
ISP2 -> ROUTER -> WAN3

So, I assigned the needed IP to the router an then connected it to the WAN port in the firewall.

May not seem pretty, but it works.

Tanks to everyone!