Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables opening certain ports to certain ipaddresses
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
gpark
n00b
n00b


Joined: 13 Jul 2004
Posts: 10

PostPosted: Fri Nov 05, 2004 7:27 am    Post subject: iptables opening certain ports to certain ipaddresses Reply with quote

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
View user's profile Send private message
nightblade
Guru
Guru


Joined: 20 Jul 2004
Posts: 368
Location: back from SE Asia

PostPosted: Fri Nov 05, 2004 9:48 am    Post subject: Reply with quote

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
View user's profile Send private message
gpark
n00b
n00b


Joined: 13 Jul 2004
Posts: 10

PostPosted: Fri Nov 05, 2004 10:45 am    Post subject: Reply with quote

thanx,

::: Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum