[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Using iptables
- Subject: [ale] Using iptables
- From: jimpop at yahoo.com (Jim Popovitch)
- Date: Sun, 25 Jun 2006 00:23:10 -0400
- In-reply-to: <[email protected]>
- References: <[email protected]>
Terry Bailey wrote:
> I would like to use iptables to restrict all but one IP address to a web
> server.
>
> I tried
>
> #/usr/sbin/iptables -t filter -A INPUT -p tcp -s !218.23.45.2 --dport 80
> -j DROP
>
> but this is not accepted.
>
> Any help here would be appreciated.
I've never used "!" in iptables statements, but this should work for you:
iptables -A INPUT -p tcp -s 218.23.45.2 --dport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP
hth,
-Jim P.