iptables Rules to block specific IP ranges
by upnort from LinuxQuestions.org on (#5BYGP)
This question probably is generic, but as the target will be my Slackware computers I'll post here.
I want to block all possible traffic for some specific private IP ranges, including ping tests. Anything on my Slackware computers that attempt to access these IP addresses should fail.
I'm not an iptables wizard. From what I have read I think the following will succeed?
Code:# Block 10.0.0.0 - 10.40.0.0 (10.0.0.0/10)
iptables -A OUTPUT --dst-range 10.0.0.0-10.40.0.0 -j REJECT
# Block 172.16.0.0 - 172.16.255.255 (172.16.0.0/16)
iptables -A OUTPUT -d 172.16.0.0/16 -j REJECTThanks again. :)


I want to block all possible traffic for some specific private IP ranges, including ping tests. Anything on my Slackware computers that attempt to access these IP addresses should fail.
I'm not an iptables wizard. From what I have read I think the following will succeed?
Code:# Block 10.0.0.0 - 10.40.0.0 (10.0.0.0/10)
iptables -A OUTPUT --dst-range 10.0.0.0-10.40.0.0 -j REJECT
# Block 172.16.0.0 - 172.16.255.255 (172.16.0.0/16)
iptables -A OUTPUT -d 172.16.0.0/16 -j REJECTThanks again. :)