Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

migrated from stackoverflow.com Feb 1 '12 at 18:47

This question came from our site for professional and enthusiast programmers.

    
what's the IP of the server you are trying this from ? –  Yahia Feb 1 '12 at 18:32
    
it is 10.100.1.1. But is that relevant ? –  Vijay Gharge Feb 1 '12 at 19:29
add comment

2 Answers

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.

share|improve this answer
    
Thnx. Please advise how to test retry from application side? –  Vijay Gharge Feb 1 '12 at 19:27
    
You want your application can trace the route deletion like traceroute? –  Shiplu Feb 1 '12 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. –  Vijay Gharge Feb 2 '12 at 17:33
    
Then use ifconfig eth0 down unless you are also connected from the same interface. –  Shiplu Feb 2 '12 at 17:43
add comment

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
share|improve this answer
    
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. –  Vijay Gharge Feb 2 '12 at 17:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.