Is this type of routing possible?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I've got a strange situation here at work in my lab.
I have a RH 6.2 (2.2.16-3) box that has N of default gateway routers and M
number of IP aliases.  Each router is actually on the same subnet as I am
but each contains a list of non-overlapping IP's to route to my Linux
box.

Currently the default routes were created with
  route add default gw <gateway IP> <device>
Of course with simply defining multiple default routes and all the GW's
being up, my box always tries to send packets to the first GW in the
routing table.  (I know this is how it's supposed to work.)

Is there a way that when a TCP connection (ex: SSH) is made to one
of the IP aliases on my Linux box, that it will respond and use
the GW that the SYN packet came through?  Anything that I can
configure on the LinuxBox since the GW's are untouchable?
Are there any elegant solutions?


Example:
In the diagram below a machine in the intranet, lets a host with IP
148.34.100.1 tries to SSH to to 148.34.200.10 via GW1, everything works
fine because the first default route on LinuxBox points to GW1.
But when 148.34.101.1 tries to SSH to 148.34.201.10 via GW2,
LinuxBox can't return the TCP packets through GW2 and responds via GW1.
If I reverse the default routes, then this works (way it's supposed to
work of course).

LinuxBox ( IP 192.168.1.1/24
           IP Aliases:
              148.34.200.1-253/24
              148.34.201.1-253/24
           Default GW's to GW1 and GW2 )

GW1 (IP eth0 148.34.200.254/24
        eth1 148.34.100.10/24
     Route to 148.34.200.x/24 via eth0
     Default route to eth1 )

GW2 (IP eth0 148.34.201.154/24
        eth1 148.34.101.10/24
     Route to 148.34.201.x/24 via eth0
     Default route to eth1 )

------------  eth0
| LinuxBox |----------------
------------               |
                           | eth0 ------- eth1  **************************
                           |------| GW1 |-------*     148.34.100.x/24    *
                           |      -------       **************************
                           |                    * Intranet 148.34.x.x/24 *
                           | eth0 ------- eth1  **************************
                           |------| GW2 |-------*     148.34.101.x/24    *
                           |      -------       **************************


Thanks,
Tuan


-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux