Article 5BYGP iptables Rules to block specific IP ranges

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. :)latest?d=yIl2AUoC8zA latest?i=yjc5-O8x6Cs:gxE4--tdwgg:F7zBnMy latest?i=yjc5-O8x6Cs:gxE4--tdwgg:V_sGLiP latest?d=qj6IDK7rITs latest?i=yjc5-O8x6Cs:gxE4--tdwgg:gIN9vFwyjc5-O8x6Cs
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments