Click to See Complete Forum and Search --> : IP tables question


lordmiki
06-18-2002, 04:36 PM
If u use --source 10.0.0.0/24 -j reject , will that block all ips from 10.0.0.0 to 10.0.0.255 respective?.

What would be the correct expresion to block wider ip ranges... ie 10.0.*

Something like this perhaps ...
10.0.0.0\255.255.0.0 ?

[ 18 June 2002: Message edited by: lordmiki ]

[ 18 June 2002: Message edited by: lordmiki ]

mychl
06-18-2002, 05:03 PM
I'm not sure, but maybe it's possible for you to block ALL incoming packets.

Then you can specifically allow certain IP's if needed.

lordmiki
06-18-2002, 05:11 PM
I could :) But it would take much more time than to just block specific ip ranges.

What you sugest is "ignore everything" then allow specific ips. But if i want to allow hundreds of ips i would have a lot of typing to do.

nuisance
06-18-2002, 05:27 PM
Originally posted by mirza:
<STRONG>If u use --source 10.0.0.0/24 -j reject , will that block all ips from 10.0.0.0 to 10.0.0.255 respective?.</STRONG>

Yes.

<STRONG>What would be the correct expresion to block wider ip ranges... ie 10.0.*

Something like this perhaps ...
10.0.0.0\255.255.0.0 ?
</STRONG>

10.0.0.0/255.255.0.0 or 10.0.0.0/16

Yes.

This (http://people.unix-fu.org/andreasson/iptables-tutorial/iptables-tutorial.html) might be helpful.

[ 18 June 2002: Message edited by: nuisance ]

Lorithar
06-20-2002, 11:43 PM
iptables -P {tablename} deny

sets the policy of a table to deny by default. After that you can then enable things with -j ACCEPT