LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices



Reply
 
Search this Thread
Old 04-01-2005, 10:54 AM   #1
xathras
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 192.168.1.5 -d 192.168.1.2 -p tcp --dport ssh -j ACCEPT

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

iptables -A FORWARD -s 192.168.1.7 -d 192.168.1.2 -p tcp --dport ssh -j ACCEPT
 
Old 04-01-2005, 02:56 PM   #2
Technoslave
Member
 
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
 
  


Reply


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 04:43 PM
iptables vs hosts.deny ryedunn Linux - Security 2 01-11-2005 07:56 PM
Iptables to block everything except few hosts sysadmcse Linux - Security 1 09-16-2003 10:48 PM
hosts.allow & iptables toddydog Linux - Networking 1 08-23-2003 12:09 PM
Using iptables and hosts.deny? Poetics Linux - Security 8 07-19-2003 03:31 PM


All times are GMT -5. The time now is 06:14 PM.

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