1

I want to test "connection retry" with remote application server. For this, I am using route method, wherein I remove static route from my linux server and check if the connectivity goes down or not. Surprisingly, connectivity doesn't go down & I can ping remote host too ! Any clue ? I am using RHEL 4.

Only thing that stops working is traceroute to the remote host.

Following are the 2 commands that I use to remove static route. Are they enough ?

route del -host 10.151.1.14 gw 10.200.1.1   
ip route flush cache                             

Thanks!

2
  • what's the IP of the server you are trying this from ?
    – Yahia
    Feb 1, 2012 at 18:32
  • it is 10.100.1.1. But is that relevant ? Feb 1, 2012 at 19:29

2 Answers 2

6

Connectivity should not go down.

When any connection is opened by some program or user it first finds the best route. After that it connects. After that connection persists.
Now if you remove any route the active connections will not go down. Because they are not seeking best route after making connection. Do you every day ask what is the best way to go to your university? Connection is made, its purpose is served.

If you want to make the connection down. Disconnect the route. Means put something in the route so that packet can not pass. It can be easily done by ifconfig eth0 down. of if-down After that the link is down. So all the connection that were using the link will be broken.

4
  • Thnx. Please advise how to test retry from application side? Feb 1, 2012 at 19:27
  • You want your application can trace the route deletion like traceroute? Feb 1, 2012 at 19:43
  • I want to simulate network disconnection @my server side, which is already serving production traffic. So I thought of removing static route for specific client & restore it again after some time & test if the connectivity restores back or not. Feb 2, 2012 at 17:33
  • Then use ifconfig eth0 down unless you are also connected from the same interface. Feb 2, 2012 at 17:43
1

Use the firewall instead. Something like:

iptables -I OUTPUT -d 10.151.1.14 -j DROP

So, this should drop all traffic heading out from the box to IP address 10.151.1.14. To remove the rule, run:

iptables -D OUTPUT -d 10.151.1.14 -j DROP
1
  • Thanks Cjc for response, but I want to simulate network disconnection @my server side, which is already serving production traffic. So I thought of removing static route for specific client & restore it again after some time. Feb 2, 2012 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .