OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 19.1 Legacy Series »
  • 2 NIC with same GW
« previous next »
  • Print
Pages: [1]

Author Topic: 2 NIC with same GW  (Read 3286 times)

555|STi

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • Sorry I'm late. I didn't want to come.
    • View Profile
2 NIC with same GW
« 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.

  • LAN
  • WAN DHCP
  • WAN STATIC IP: AAA.BBB.CCC.DDD
  • WAN STATIC IP: AAA.BBB.CCC.EEE

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!
Logged
OPNsense 19.1.4-amd64
FreeBSD 11.2-RELEASE-p9-HBSD
OpenSSL 1.0.2r 26 Feb 2019
Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (8 cores)
8GB RAM
500 GB HDD

tong2x

  • Full Member
  • ***
  • Posts: 205
  • Karma: 9
    • View Profile
Re: 2 NIC with same GW
« Reply #1 on: September 06, 2019, 02:07:20 am »
when you say it is for remote access... is it really a WAN?
Logged

555|STi

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • Sorry I'm late. I didn't want to come.
    • View Profile
Re: 2 NIC with same GW
« Reply #2 on: September 06, 2019, 05:31:55 am »
L
Quote from: tong2x on September 06, 2019, 02:07:20 am
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.
Logged
OPNsense 19.1.4-amd64
FreeBSD 11.2-RELEASE-p9-HBSD
OpenSSL 1.0.2r 26 Feb 2019
Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (8 cores)
8GB RAM
500 GB HDD

mimugmail

  • Hero Member
  • *****
  • Posts: 6300
  • Karma: 434
    • View Profile
Re: 2 NIC with same GW
« Reply #3 on: September 06, 2019, 05:48:26 am »
This cant work as gateways are bound to interfaces.
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

ruffy91

  • Jr. Member
  • **
  • Posts: 79
  • Karma: 9
    • View Profile
Re: 2 NIC with same GW
« Reply #4 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.
Logged

555|STi

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
  • Sorry I'm late. I didn't want to come.
    • View Profile
Re: 2 NIC with same GW
« Reply #5 on: September 07, 2019, 10:59:22 pm »
Quote from: 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.
Interesting! I'll try this!
Thank you!

Quote from: mimugmail on September 06, 2019, 05:48:26 am
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!
Logged
OPNsense 19.1.4-amd64
FreeBSD 11.2-RELEASE-p9-HBSD
OpenSSL 1.0.2r 26 Feb 2019
Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (8 cores)
8GB RAM
500 GB HDD

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • Archive »
  • 19.1 Legacy Series »
  • 2 NIC with same GW
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2