Search This Blog

Monday, May 5, 2008

how to add a route to a host

i was not getting ssh to one of the machines because there was no route from that host to my machine, i just added a route with the following command. Then i was able to ssh to that host machine.
[root@arjun ~]# #route add default gw 192.168.2.11 [root@arjun ~]# netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 192.168.2.10 0.0.0.0 UG 0 0 0 eth0 [root@arjun ~]# route add -net 192.168.20.0 netmask 255.255.255.0 gw 192.168.2.200 [root@arjun ~]# netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.20.0 192.168.2.200 255.255.255.0 UG 0 0 0 eth0 192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0.0.0.0 192.168.2.10 0.0.0.0 UG 0 0 0 eth0 [root@arjun ~]#

No comments: