Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Security
User Name
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.


  Search this Thread
Old 04-01-2005, 09:54 AM   #1
LQ Newbie
Registered: Jun 2004
Posts: 25

Rep: Reputation: 15
Iptables - Group Of Hosts

Is there any way in Iptables of being able to include a group of hosts to be able to access a service.

For example I have 3 machines on my network that I want to accept ssh connections to my machine but no others

Rather than doing this:

iptables -A FORWARD -s -d -p tcp --dport ssh -j ACCEPT

iptables -A FORWARD -s -d -p tcp --dport ssh -j ACCEPT

iptables -A FORWARD -s -d -p tcp --dport ssh -j ACCEPT
Old 04-01-2005, 01:56 PM   #2
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
You could figure out how masks work and try it that way ( although at most you'll be stuck with 4 hosts in the range, not the 3 you want ), or you could also do your /etc/hosts.allow and /etc/hosts.deny


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables and hosts.allow bwreath Linux - Security 2 02-25-2005 03:43 PM
iptables vs hosts.deny ryedunn Linux - Security 2 01-11-2005 06:56 PM
Iptables to block everything except few hosts sysadmcse Linux - Security 1 09-16-2003 09:48 PM
hosts.allow & iptables toddydog Linux - Networking 1 08-23-2003 11:09 AM
Using iptables and hosts.deny? Poetics Linux - Security 8 07-19-2003 02:31 PM > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration