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 problems

hi, i have astaro 4 with 3 nic installed.
eth0 private network
eth1 leased line with static public ip's
eth2 dsl with dynamic ip
eth1 and eth2 have both a default gateway to their routers.
eth2 is the primary default gateway because of the order of the cards in the pci slots.
eth1 holds 3 vpn connection ( with static routes ...)
My Problem is, if i ping from outside the public ip of the leased line ( eth1) there comes no replay. if i trace the route i can see my leased line router and a few hops later my dsl gateway ?! why don´t answer astaro from eth1, if eth1 is the destination ? so my smtp proxy is not avaiable on eth1 if i have a default route on eth2. if there is no default route on eth2 everything works fine ( but the usual traffic should go over DSL ...)

cu andré

regards andré  


This thread was automatically locked due to age.
Parents Reply Children
  • hi , it looks like it works with emule, but the http/ftp traffic withthe http proxy still goes over eth1 ..
    here is my script:

      /bin/ip rule del fwmark 2 table 200
      /bin/ip route del default via 10.100.1.1 dev eth2 table 200
      # flush mangle table too
      /usr/local/bin/iptables -t mangle -F

      # mark HTTP, HTTPS, FTP, EMULE traffic from our LAN in
      # the "mangle" table


      /usr/local/bin/iptables -A PREROUTING -t mangle -p tcp -s 10.100.0.0/24 --dport 80 -j MARK --set-mark 2
      /usr/local/bin/iptables -A PREROUTING -t mangle -p tcp -s 10.100.0.0/24 --dport 8080 -j MARK --set-mark 2
      /usr/local/bin/iptables -A PREROUTING -t mangle -p tcp -s 10.100.0.0/24 --dport 443 -j MARK --set-mark 2
      /usr/local/bin/iptables -A PREROUTING -t mangle -p tcp -s 10.100.0.0/24 --dport 20:21 -j MARK --set-mark 2
      /usr/local/bin/iptables -A PREROUTING -t mangle -p tcp -s 10.100.0.0/24 --dport 3000:10000 -j MARK --set-mark 2
      /usr/local/bin/iptables -A PREROUTING -t mangle -p udp -s 10.100.0.0/24 --dport 33000:34000 -j MARK --set-mark 2

      # now create a table with id '200' with one
      # rule to match our mark. We do not need
      # to match the source address again, since
      # iptables already did this for us.
      /bin/ip rule add fwmark 2 table 200
      /bin/ip route add default via 10.100.1.1 dev eth2 table 200
      # flush cache
      /bin/ip route flush cache

    what´s wrong with it ??
        
  • Hi,
    so what in this special config with two default-gateways is the handling of packets for wich are no route is defined. are they going out on both interfaces or just on one of them and if only on one wich is it ?

    firebear  
  • Are your needs for inbound connections like SMTP etc?  If you are using the SMTP proxy or NAT rules for other inbound services it should work no problem without the source route hack.  Two defaut gateways and proper rules for each line is all you need for inbound services.  I also add SNAT rules for packets leaving a particular external interface to source to that interface.  Seems redundent but makes sure the return goes down the line it came in on.

    Outbound connections are more tricky but with static routes and known connections it can work.

    I typicaly primary default GW to the DSL so internal traffic bound for the internet goes that way and secondary GW to the leased line and point most inbound traffic and VPNs that way.

    An example is to set MX to both interfaces and I can see inbound email coming in on either line depending on conditions.

    A caveat are static routes and you try to come in from the other end via the other interface that isn't on the static route.