pfSense Support Subscription

Author Topic: Routing with multiple gateways on a single WAN intarface  (Read 247 times)

0 Members and 1 Guest are viewing this topic.

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Routing with multiple gateways on a single WAN intarface
« on: November 08, 2017, 07:33:23 am »
Hi,

I'm installing a PF firewall and trying to setup a multi WAN setup.

The PF box has it's LAN on 192.168.1.252, with a WAN of 192.168.50.101. This has a DG of 192.168.50.2, i've then added an extra gateway of 192.168.50.1.

I'd like to set it up too send traffic from 192.168.1.245 (Another router for public WiFi) out through the 192.168.50.1 gateway, then everything else out of the 192.168.50.2 gateway.

I've setup a Firewall Rule in the LAN group to send all traffic with a source address of 192.168.1.245 through the 192.168.50.1 gateway. I can see traffic going though the rule. However if i do a tracert from the 192.168.1.245 router I am still sent out through the 192.168.50.2 gateway.

Any Suggestions?

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 14299
  • Karma: +1331/-194
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #1 on: November 08, 2017, 07:36:02 am »
And what protocol is your traceroute using icmp?  Does your rule only send TCP, or does rule send everything?  Linux traceroute defaults to using UDP for example.
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x 2.4.2-RELEASE on VM esxi 6.5 (home)

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #2 on: November 08, 2017, 07:44:14 am »
Hi,

I told the rule to apply to all protocols. If i go to whatismyip.com I get the WAN ip of the 192.168.50.2 gateway, rather thn the one of the 192..168.50.1.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 14299
  • Karma: +1331/-194
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #3 on: November 08, 2017, 08:13:52 am »
Lets see your rule (screenshot please).. Not currently setup to be able to test this... But happy to try and duplicate once my pfsense is back on line.. Hardware should be in here in a week or so.. (I hope).

What OS are you using to run the traceroute?  Widnows linux?
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x 2.4.2-RELEASE on VM esxi 6.5 (home)

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #4 on: November 08, 2017, 09:23:38 am »
See attached

I was using tracert in Windows.

Thanks

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 14299
  • Karma: +1331/-194
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #5 on: November 08, 2017, 09:55:40 am »
So the client your forcing out the gateway is the client your doing the traceroute from is 192.168.1.245.. It didn't happen to get a different IP did it? ;)

You have no rules in floating?  Its not doing the traceroute via ipv6 is it? ;)

What does your outbound nat look like, you are allowing this client to be natted out your 2nd gateway?  You would need to go into hybrid or manual to allow that, etc.
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x 2.4.2-RELEASE on VM esxi 6.5 (home)

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #6 on: November 08, 2017, 10:03:02 am »
Yep, the client IP is another router with it's WAN sat on the 192.168.1.0 subnet. It's definatly got the correct IP.

There's nothing in floating, and not tracert'ing oper IPV6 as I only get response from IPV4

Outbound NAS is at default currently (See Attached). What do I need to change to allow traffic out?

Thanks

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #7 on: November 09, 2017, 05:52:09 am »
Any Ideas?

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 14299
  • Karma: +1331/-194
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #8 on: November 09, 2017, 07:31:06 am »
your outbound nats do not show this other gateway as a way to nat..

You need to enable an hybrid nat to allow your lan to nat via this other gateway when you send it that way.
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x 2.4.2-RELEASE on VM esxi 6.5 (home)

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #9 on: November 09, 2017, 09:28:05 am »
OK, so I've enabled hybrid outbound NAT & gone to add the extra rule to send traffic from 192.168.1.245 out through the 192.168.50.1 gateway. But I can't see where to specify the gateway.
Only where to specify the interface on the PF box itself. Bear in mind, I only have one WAN interface configured, then 2 gateways accessible behind that gateway.

Attached screenshot with my new rule.

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #10 on: November 10, 2017, 10:17:23 am »
Any Idea's John?

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 14299
  • Karma: +1331/-194
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #11 on: November 10, 2017, 12:04:00 pm »
My bad... I just read this over again.. I was thinking you actually had another interface for your gateway... Doh... If that was the case then you would need the outbound nat thing picking that interface.

But you only have the 1 interface and just sending to specific gateway..

So your not using any sort of proxy.. And when you got to whatsmy ip you see the correct IP for using gateway 2, but when you do traceroute your getting gateway 1.. I will really have to lab this because should work. as you have it setup.
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x 2.4.2-RELEASE on VM esxi 6.5 (home)

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #12 on: November 10, 2017, 12:11:51 pm »
Yep. That's it. No proxy or anything. Just trying to send to another gateway.

Offline johnpoz

  • Hero Member
  • *****
  • Posts: 14299
  • Karma: +1331/-194
  • Not a pfSense employee, they cannot fire me...
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #13 on: November 10, 2017, 12:21:28 pm »
If I get a chance this afternoon I will fire up a VM to lab this out.. I had done this before another thread but it was 2 different interfaces
- An intelligent man is sometimes forced to be drunk to spend time with his fools.
- Please don't PM me for personal help
- if you want to say thanks applaud or https://www.freebsdfoundation.org/donate/
1x SG-2440 2.3.4_p1 (work)
1x 2.4.2-RELEASE on VM esxi 6.5 (home)

Offline edeclipseit

  • Newbie
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Routing with multiple gateways on a single WAN intarface
« Reply #14 on: November 10, 2017, 01:00:02 pm »
That would be great. Might see if I can spin up a test setup & see what happens.