View previous topic :: View next topic |
Author |
Message |
gpark n00b
Joined: 13 Jul 2004 Posts: 10
|
Posted: Fri Nov 05, 2004 7:27 am Post subject: iptables opening certain ports to certain ipaddresses |
|
|
Hey,
is it possible to have a rule to open port 22 to just two different ip address and close to all others? If so, how can I go out doing that?
thanks,
::: Tom |
|
Back to top |
|
|
nightblade Guru
Joined: 20 Jul 2004 Posts: 368 Location: back from SE Asia
|
Posted: Fri Nov 05, 2004 9:48 am Post subject: |
|
|
Code: |
iptables -A INPUT -s <ip1> -p tcp --destination-port 22 -j ACCEPT
iptables -A INPUT -s <ip2> -p tcp --destination-port 22 -j ACCEPT
iptables -A INPUT -p tcp --destination-port 22 -j DROP
|
...as long as there are not previous rules that interphere with these 3... _________________ In God we trust. All the others must provide a valid X.509 certificate |
|
Back to top |
|
|
gpark n00b
Joined: 13 Jul 2004 Posts: 10
|
Posted: Fri Nov 05, 2004 10:45 am Post subject: |
|
|
thanx,
::: Tom |
|
Back to top |
|
|
|