Notes and resources for iptables.
iptables is the software that, among other things, lets you set up filtering rules (for firewalls), do NAT, and similar networking related things.
iptables is the default tool for this purpose in the 2.4 kernel. In other kernels:
- pre 2.2 kernel -- ??? (there was one, at least in something like 2.0)
- 2.2 kernel -- ipchains
- 2.4 kernel -- iptables
See
AboutThesePages.
Contents
Notes
Block an IP
If you want to block an ip address only from
services that use hosts.deny, add the ip address to /etc/hosts.deny.
If you want to block all network traffic from them, add the address to the iptables rules, something like this:
(from daRcmaTTeR:)
iptables -A INPUT -p tcp --dport 20:10000 -s 216.0.0.0 -j DROP
-A = tells the kernel to append this rule to already existing INPUT table rules
INPUT = name of a table
-p = flag telling the kernel what protocol to apply this rule to. (must be specified when using the "--dport" argument.
tcp = protocol name
--dport = destination port where incoming packet is bound for.
20:10000 = expression specifying all ports from 20 thru 10000
-s = source IP address
-j = target
DROP = what to do with the packet when a match is detected.
Resources
See
ResourceRecommendations. Feel free to add additional resources to these lists, but please follow the guidelines on
ResourceRecommendations including
ResourceRecommendations#Guidelines_for_Rating_Resources.
Recommended
Recommended for Specific Needs
Recommended by Others
<Currently, no significant content below this line.>
No Recommendation
Not Recommended
Contributors
- () RandyKramer - 15 Jul 2002
- Michael Viron - 14 Jul 2002
- daRcmaTTeR - 14 Jul 2002
- <If you edit this page: add your name here; move this to the next line; and include your comment marker (initials), if you have created one, in parenthesis before your WikiName.>
[[Main.RandyKramer#15 Jul 2002][]]
Page Ratings