Author Topic: How to route traffic from certain IPs via a specific gateway  (Read 2038 times)

bravolist

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
How to route traffic from certain IPs via a specific gateway
« on: November 30, 2013, 04:59:29 am »
Hello,

I have spent time on Zentyal forums for this answer, but could not find any solved topics.  Please send me a link if this is already answered in any forum.

I have two gateways and I would like to always route traffic from certain IP addresses through a specific gateway (second one in priority and slower one of the two).  Can this be done with Zentyal?  Can you please help with instructions?

Thanks

Namtrooper

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to route traffic from certain IPs via a specific gateway
« Reply #1 on: March 23, 2014, 07:24:57 pm »
Hi. did you ever find an answer? I'm trying to do exactly the same. specify specific IP's or objects to work through only specific gateways...

soori

  • Zen Apprentice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: How to route traffic from certain IPs via a specific gateway
« Reply #2 on: March 27, 2014, 07:47:16 am »
I am looking for the same too... Did you guys sort it out?

BrunovonTroba

  • Zen Monk
  • **
  • Posts: 61
  • Karma: +3/-0
    • View Profile
Re: How to route traffic from certain IPs via a specific gateway
« Reply #3 on: March 29, 2014, 11:52:36 pm »
Very simple
1.Network -> Gateways -> Balance Trafic -> Multigateway Rules
2. Add rule interface=any; Source=IP-you-want-to-redirect; destination=any; service=any; gateway=Your-choice

That way You can redirect also specific services through specific gateway

soori

  • Zen Apprentice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: How to route traffic from certain IPs via a specific gateway
« Reply #4 on: March 30, 2014, 05:02:15 am »
Thank you for your time but I have already done like you have mentioned except for rule interface eth1 (not any, I have one anyway). It didn't help me. When I check the Internet ip on the client machine it's not going through the gateway I want.

FYI. I also tried enabling balance traffic too.

BrunovonTroba

  • Zen Monk
  • **
  • Posts: 61
  • Karma: +3/-0
    • View Profile
Re: How to route traffic from certain IPs via a specific gateway
« Reply #5 on: March 30, 2014, 03:12:25 pm »
In my case I am using Zentyal 2.2 with such rules - IP1 with 100/10Mbps connection services HTTP and FTP, IP2 with 10/10Mbps services all other and it works perfect
In few days i will make a special zentyal config with 2 Wan and 2 Lan and i will post here my results. The problem is i don't know if i will use 3.3 or 3.4 version
In the meantime - try the config i have written before and check data streaming using iptraf

maikotz

  • Zen Apprentice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: How to route traffic from certain IPs via a specific gateway
« Reply #6 on: March 31, 2014, 07:40:34 am »
How did you find out that it's not going through the gateway?

I have a combination of Try SNAT under Firewall -> SNAT
and Gateways -> Balance Traffic -> Multigateway Rules  and it works fine.

BrunovonTroba

  • Zen Monk
  • **
  • Posts: 61
  • Karma: +3/-0
    • View Profile
Re: How to route traffic from certain IPs via a specific gateway
« Reply #7 on: April 02, 2014, 01:11:05 am »
Yes, in 3.3 (just tested), using only balance traffic does not work as expected - when You check Your IP, You will always get default gateway IP, however IPTRAF shows traffic on proper (chosen) interface depending on rule

In Zentyal 2.2 using only balance traffic works fine, showing different IP addresses