Tuesday, October 20, 2009

IP/Port Blocking

Q. All machines with IP range 10.10.10.x should have access to Port 80 on
(Machine 10.10.10.xx). and rest all should be blocked.

Ans.
Via IPTABLES

iptables -A INPUT -s 10.10.10.0/24 -p tcp --destination-port 80 -j
ACCEPT
iptables -A INPUT -p tcp --destination-port 80 -j DROP

Via Hosts

in hosts.allow
80: 10.10.10.0/24

in hosts.deny
80: ALL

No comments:

Post a Comment