[ Team LiB ] |
Recipe 2.6 Blocking Incoming Service Requests2.6.1 ProblemYou want to block connections to a particular network service, for example, HTTP. 2.6.2 SolutionTo block all incoming HTTP traffic: # iptables -A INPUT -p tcp --dport www -j REJECT # ipchains -A input -p tcp --dport www -j REJECT To block incoming HTTP traffic but permit local HTTP traffic: # iptables -A INPUT -p tcp -i lo --dport www -j ACCEPT # iptables -A INPUT -p tcp --dport www -j REJECT # ipchains -A input -p tcp -i lo --dport www -j ACCEPT # ipchains -A input -p tcp --dport www -j REJECT 2.6.3 DiscussionYou can also block access at other levels such as TCP-wrappers. [Recipe 3.9][Recipe 3.11] 2.6.4 See Alsoiptables(8), ipchains(8). |
[ Team LiB ] |