Iptables: port 22 open only for my IP

Pete Nesbitt pete at linux1.ca
Thu Jun 24 03:32:22 UTC 2004


On June 23, 2004 02:16 am, Khan wrote:
> What will be the best way to put one more Ip adrress to:
>
> # Accept local (192.168.5.0/24) SSH traffic
> $IPT -A INPUT -m state -p tcp --dport 22 ! --state INVALID -s
> 192.168.5.0/24 -j ACCEPT
> $IPT -A OUTPUT -m state -p tcp --sport 22 --state ESTABLISHED,RELATED -d
> 192.168.5.0/24 -j ACCEPT
>
> TNX

Hi,
I think you'll need to repeat the entries  because the -s option does not 
accept a list, just a single ip (or host) or a single network/mask entry.
-- 
Pete Nesbitt, rhce





More information about the redhat-list mailing list