0

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 ?

2 Answers 2

2

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).

0
2

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 
$

You must log in to answer this question.

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