Routing question from a non-expert (two gateways problem)

Linux Advanced Routing and Traffic Control

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

 



I have the following network layout:



 +---------------------------------------------------------------------------------------------------------------------------------------------------------------+              +----------------+
 |                                                                                                                                                                 |                |                  |
 |                                           INTERNET                                                                                                   |----------------|  EXTBOX |
 |                                                                                                                                                                 |                |                  |
 +---------------------------------------------------------------------------------------------------------------------------------------------------------------+               +----------------+
       |                                                                                                                                                |
       |                                                                                                                                                |
       |                                                                                                                                                |
       |                                                                                                                                                |
       |                                                                                                                                                |
       |WAN                                                                                                                                        |WAN
 +-------------------+                                              +-----------------------+                                              +------------------+
 |                     |LAN                                  eth1|                        |eth2                                  LAN|                   |
 |  ROUTER1  |-------------------------------------------------|     MIDBOX    |------------------------------------------------| ROUTER2 |
 |                     |192.168.1.254       192.168.1.1|                        |192.168.2.1      192.168.2.254|                   |
 +-------------------+                                               +----------------------+                                              +------------------+
                                                                             eth0|192.168.0.1
                                                                                    |
                                                                                    |
                                                                                    |
                                                                          +-----------------+
                                                                           |                  |
                                                                           |  SWITCH  |
                                                                           |                   |
                                                                          +------------------+
                                                                                    |
                                                                                    |
                                                                             eth0|192.168.0.101
                                                                       +--------------------+
                                                                        |                     |
                                                                        |   INTBOX    |
                                                                        |                     |
                                                                       +--------------------+



with the following network configuration:

ROUTER1 (asus rtn66u router):

- knows about 192.168.0.0 network via 192.168.1.1
- ssh tcp 22 on WAN redirected to 192.168.1.1

ROUTER2 (asus rtac3200 router):

- knows about 192.168.0.0 network via 192.168.2.1
- ssh tcp 22 on WAN forwarded to 192.168.2.1

MIDBOX:

allow-hotplug eth0
iface eth0 inet static
  address 192.168.0.1
  netmask 255.255.255.0

allow-hotplug eth1
iface eth1 inet static
  address 192.168.1.1
  netmask 255.255.255.0
  gateway 192.168.1.254       <<<===== default gateway (router1)
  ### static routing ###
  #post-up route add -net 10.101.0.0 netmask 255.255.255.0 gw 192.168.1.254
  #pre-down route del -net 10.101.0.0 netmask 255.255.255.0 gw 192.168.1.254

echo 1 rtnac3200 >> /etc/iproute2/rt_tables

allow-hotplug eth2
iface eth2 inet static
  address 192.168.2.1
  netmask 255.255.255.0
  ### static routing ###
  post-up ip route add 192.168.2.0/24 dev eth2 src 192.168.2.1 table rtnac3200
  post-up ip route add default via 192.168.2.254 dev eth2 table rtnac3200               <<<<===== secondary gateway (router2)
  post-up ip rule add from 192.168.2.1/32 table rtnac3200
  post-up ip rule add to 192.168.2.1/32 table rtnac3200

INTBOX:

iface eth0 inet static
  address 192.168.0.101
  netmask 255.255.255.0
  gateway 192.168.0.1

##########
# QUESTION #
##########

I've created the 'rtnac3200' table so that I can ssh into MIDBOX from EXTBOX no matter what router I use.

The problem I have now is that from INTBOX I get no replies when I ping 192.168.2.1 (any other interface does reply though)



How should I modify my configuration to solve this problem?



PS: hopefully I'm posting to question to the right mailing list.--
To unsubscribe from this list: send the line "unsubscribe lartc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux