Facing problem with the following networking set up in linux
Hi all,
I am trying to create the following set up
I have following linux networking set up.
Machine A Ip-10.8.11.100 (Source machine)
Machine B ip-10.8.11.1 (acting as a gateway for 10.5.0.0 network )
Machine C ip-10.8.11.2 (acting as a gateway for 192.68.11.0 network )
Machine D ip-10.5.0.1 (Dest machine)
Machine E ip-192.168.11.1 (Dest machine)
Machine F ip-10.8.11.5 (default agteway)
Now I want to add both the destination networks into Machine A so that I should able to ping ip address of both the networks from it.
The rules and routes that I ave added on machine A a below :-
$ip rule add from 10.8.11.100 table 2
$ip route add 10.5.0.0/24 via 10.8.11.1 dev eth0 src 10.8.11.100 table 2
$ip route add 192.168.11.1 via 10.8.11.2 dev eth0 src 10.8.11.100 table 2
$ip route add default via 10.8.11.5 table 2
$ip route flush cache
Here the rules on the Machine A
$ip rule show
0: from all lookup local
32763: from 10.8.11.100 lookup 2
32766: from all lookup main
32767: from all lookup default
Here are the routes in table 2 of machine A
$ip route show table 2
192.168.11.0/24 via 10.8.11.2 dev eth0 src 10.8.11.100
10.5.0.0/24 via 10.8.11.1 dev eth0 src 10.8.11.100
default via 10.8.11.5 dev eth0
Now what is happening is when I trying to ping any destination from Machine A, I am not getting any ping reply from any of the network and I think the packet is also not reaching to destination machine as I am not seeing anything in the tcpdump traces at the destination.(Machine D & Machine E).
Now when I am adding the same rules to the main table of linux everything is working fine . I can able to ping all the static as well as default networks from machine A.
I don't know whts was happening when I am adding the same routes to table 2.
A part from that I am directly using the table index 2 without adding its entry in /etc/iproute2/rt_tables file.
Is it necessary to add the table name into that file.?
I did that as well but looks like it is not working out.
How can we know which routing table currently linux is using.?
Please help me here
Last edited by maverickpaaras; 08-02-2012 at 02:39 PM.
|