Iptables: port 22 open only for my IP
Sasa Stupar
sasa at stupar.homelinux.net
Wed Jun 23 08:39:30 UTC 2004
Khan pravi:
> Khan wrote:
>
>> Hello,
>>
>> I am total beginner to Linux and I'm trying to learn iptables basics.
>> I would like to learn how to close all ports but 80, 20, and that
>> ports 22 and 10000 will be open only to my IP address.
>
>
> OK,
>
> here is what I got so far:
>
> # 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
>
> That will allow all 192.168.5.* addresses to access port 22. How Can I
> have only:
>
> 192.168.5.3
> and
> 192.168.5.4
>
> to access my 22 port. Tutorial I used is from:
>
> http://linuxcourse.rutgers.edu/lessons/lecture9.html
>
> TNX
>
>
Or maybe you should use GUI frontend called Firestarter which is very
easy to manipulate. http://firestarter.sourceforge.net
More information about the redhat-list
mailing list