close port 80 but allow some IPs to use port 80
Hi all,
how do i close port 80 to all users except for a few ips ? the generic match of --dport doesn't work for me.
many thanks,
alanchia
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
Quoted 3 lines
how do i close port 80 to all users except for a few ips ? the generic match
of --dport doesn't work for me.
Why not ?
Are these users on your LAN or on the internet ?
Do these users have a fixed IP ?
iptables -P INPUT DROP
iptables -A INPUT -s <src_ip> -p tcp --dport 80 -j ACCEPT
...
iptables -A INPUT -s <src_ip> -p tcp --dport 80 -j ACCEPT
Or maybe you can use the MAC address match.
iptables -P INPUT DROP
iptables -A INPUT -m mac --mac-source <src_mac> -p tcp --dport 80 -j ACCEPT
...
iptables -A INPUT -m mac --mac-source <src_mac> -p tcp --dport 80 -j ACCEPT
Rob