This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

2 gateway and routing / policy routing

I have 2 internet gateway (configuration as below) and a problem.

eth1 80.100.111.66 mask 255.255.255.240 gw 80.100.111.65

eth1:1 81.222.111.130 mask 255.255.255.224 gw 81.222.111.129

(the ip are not real, they are of example)

Some DNAT rules masq some servers on 80 class and other servers on 81 class.

The problem is that when primary default gw is 80.100.111.65, services on servers on 81.222.111.x don't work. 
If i change gw order setting primary gw to 81.222.111.129, services on 81.222.111.x work, but services on 80.100.111.x stop to work.

I suppose the problem is that reply packets leave firewall correctly Natted but always routed to primary default gw. And if this gw is the wrong gw, it drops the packets because they aren't in his subnet.

How can i tell to ASL that traffic which is arrived on subnet 81.222.111.x MUST use 81.222.111.129 gw for reply packets, and so for other subnet.

I have tried Policy routing, but with unsuccess.

Best Regards
Fabrizio

Sorry for my bad English


This thread was automatically locked due to age.
Parents
  • Hi all,
    i have a similar configuration and following work fine for me:

    eth0 Internal
    eth1 External_HDSL (Mail/Web/Ftp servers)
    eth2 External_Fiber

    default gw on eth2

    NAT/Masquerding Rules:
    1) Dnat/Snat
    -- Packet to match - source: eth0_network - Destination: eth1_network - Service: :: No Match ::
    -- Change source to: :: MASQ on 'External_HDSL' ::
    -- Change destination: :: No Change ::
    2) Masquerade eth0_network on eth2 

    I reach the Mail/Web/Ftp servers over the eth1 NIc even if i have the default gw over eth2

    Have a nice day
    Andrea 
        
  • What is your IP setup like....I am guessing that you only have one gateway running. on your nics which is eth2. The poblem that I have in a differnt post and everyone else here has is that once 2 gateways are on the firewall everything goes to hell. And no one here has ever been able to say how to add static routes under astaro. I have 5 nics to GWs and one Public range for my DMZ that has to route through a specific GW otherwise the DMZ is hosed. My temporary work around was to throw up a cheap Linksys Cable/DSL router put a secondary GW on my windows network and enter manual routes via a command prompt into my workstations and they now know which gateway to route the traffic through but I lose Firewall functions on the secondary gateway this way. Kind of funny how the Linux Heads swear by linux and its flexability and 5 months later no one on the forum has a clue on getting 2 gateways running and I can do it on a Windows system in under a minute....hmmmm now there is food for thought  [:$]  
  • If the ASL has 6 interfaces as suggested then we would need a better way to visualize the set-up and needs.  Hard to picture where it is falling down.

    ASL 4 can have multiple gateways with a priority order to them but that isn't the problem.  You can easily add static routes right in webmin.

    If there are two interfaces pointing at the internet and there is a problem with DMZ traffic coming in via the non default gateway then a DNAT is the answer if policy routing doesn't work (it should).

    You would DNS a DMZ server to the internet IP instead of the real IP and DNAT it over to the DMZ.  This should send the reply back down the desired GW.  You would set default GW on both internet interfaces and decide which is the primary.

    And I seriously doubt that Linux is lacking in routing capabilities vs any Windows version.  Matter of correct structure and then config.
      
  • Youre suggestion causes a number of problems. The Static routes in webadmni don't work period. DNAT would reassign a Public address to the Gateway address instead of it own address which causes problems if you have multiple Public addresses that need to use their own addresses. Also it doesn't resolve the problem of the Private IP utilizing the secondary gateway which is needed. I can't beleive this problem has been bounced around this forum for over 5 months and no one knows how to get around this limitation. I guess ASL personel dont monitor these forums.  
  • The routes do work, maybe not to your liking or maybe you are missing something.  Typical static routes work exactly as they should.  Can't say to your case but an example of mine that requires a specific source IP is:
    One DSL with GW, one cable modem with GW (as secondary), and two internal subnets.  Anything that must route over the cable has a static route pointing at the cable GW and an SNAT that sets the source to the cable interface.  This works for sure if the source (internal net/s) and destination is known.
    More difficult to set a route based on an unknown source IP and I hope ASL gets that working.  But Windows isn't doing that out of the box either.  However, if outside users only hit the outside interface and I NAT/DNAT it works for most uses.  So for things like VPN you have to route over the default GW but most things can be done.
       
  • But guess what 1 mnute routing done on a Windows box 5 months of posts I have been reading on this forum and no one has put in plain english this is what you do to set static routes with 2 gateways....I'll take the Windows beating any day.  
  • Sorry (also for my poor english), i omitted something of my configuration and then i modified some other rule.

    I have two connection, 1st (HDSL) whith half class C and 2nd (Fiber) with a class C.

    This is my conf on ASL 3.218 (IP aren't real):
    eth0 Internal 10.10.10.1/24 (no gw)
    eth1 External_HDSL 1.2.3.254/25 gw 1.2.3.129
    eth2 External_Fiber 5.6.7.2/25 gw 5.6.7.1
    eth2:1 External_Fiber_DMZ 5.6.7.129/24  (no gw)

    default gateway 5.6.7.1 (on eth2)
    (secondary gw is 1.2.3.129)

    Two Masquerading Rules for Internal Network (i modified the DNAT/SNAT Rules in my previous message, it was not necessary) 1 for the fiber conn and 1 for the HDSL conn.

    I have put some packet filter rule dropping all traffic direct to Internal and also direct to DMZ, then other rules for allowing netowrks in eth1 and in eth2 to be reacheable from Any, and, finally, rules allowing cross connection trought the firewall for eth1 - eth2 - eth2:1 networks (i.e. From eth1_net - Services Any - To eth2_net - Action Allow)

    Pay particular attention to rules and  their sequences that can broke security ....

    And the ASL configuration is done
    Now, obviously:
    all workstations in lan 1.2.3.128/25 have default gw set to 1.2.3.254 (eth1 in the firewall);
    all ws in 5.6.7.0/25 default gw is 5.6.7.2 (eth2 in the fw) ;
    all ws in 5.6.7.128/25 default gw is 5.6.7.129 (eth2:1 in the fw);

    And that it's all   ..... (if i didn't forget something else)              
Reply
  • Sorry (also for my poor english), i omitted something of my configuration and then i modified some other rule.

    I have two connection, 1st (HDSL) whith half class C and 2nd (Fiber) with a class C.

    This is my conf on ASL 3.218 (IP aren't real):
    eth0 Internal 10.10.10.1/24 (no gw)
    eth1 External_HDSL 1.2.3.254/25 gw 1.2.3.129
    eth2 External_Fiber 5.6.7.2/25 gw 5.6.7.1
    eth2:1 External_Fiber_DMZ 5.6.7.129/24  (no gw)

    default gateway 5.6.7.1 (on eth2)
    (secondary gw is 1.2.3.129)

    Two Masquerading Rules for Internal Network (i modified the DNAT/SNAT Rules in my previous message, it was not necessary) 1 for the fiber conn and 1 for the HDSL conn.

    I have put some packet filter rule dropping all traffic direct to Internal and also direct to DMZ, then other rules for allowing netowrks in eth1 and in eth2 to be reacheable from Any, and, finally, rules allowing cross connection trought the firewall for eth1 - eth2 - eth2:1 networks (i.e. From eth1_net - Services Any - To eth2_net - Action Allow)

    Pay particular attention to rules and  their sequences that can broke security ....

    And the ASL configuration is done
    Now, obviously:
    all workstations in lan 1.2.3.128/25 have default gw set to 1.2.3.254 (eth1 in the firewall);
    all ws in 5.6.7.0/25 default gw is 5.6.7.2 (eth2 in the fw) ;
    all ws in 5.6.7.128/25 default gw is 5.6.7.129 (eth2:1 in the fw);

    And that it's all   ..... (if i didn't forget something else)              
Children
No Data