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 learn the rounte command can add the reject rule by:

route add -host aaa.bbb.ccc.ddd reject

But, I have no idea to display the reject rules set. How to get the all reject rules set by others ?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

On Linux at least, the route command shows reject-routes with a ! in the Flags column, so something like:

route | egrep 'Flags|!'

will show you just the reject-routes (and the headers).

share|improve this answer
    
thanks, I also found the command: ip route show –  qrtt1 Mar 19 '11 at 10:58
add comment

The ip command can be used to show only these routes, they're called "unreachable" in ip. For example:

$ sudo route add 8.8.8.8 reject
$ sudo ip route add unreachable 8.8.4.4
$ sudo ip route ls type unreachable
8.8.4.4 
8.8.8.8  scope host 
$
share|improve this answer
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.