nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

IPTABLES help

This is a discussion on IPTABLES help within the Linux software forums, part of the Linux Getting Started category; Hi Everyone, I need some help in IPTABLES. I have 5 machines running Linux. I have to configure iptables on ...


Go Back   nixCraft Linux Forum > Linux Getting Started > Linux software

Register FAQ Members List Calendar Forgotten your password? Mark Forums Read
  #1 (permalink)  
Old 03-08-2005, 07:16 PM
Junior Member
User
 
Join Date: Feb 2005
Posts: 5
Rep Power: 0
vasanth
Default IPTABLES help

Hi Everyone,

I need some help in IPTABLES. I have 5 machines running Linux. I have to configure iptables on all the machines in such a way that only the ports (+ any necessary port used by our product (I'm a product Tester) has to be opened in all the machines. All the five machines should ACCEPT requests only among themselves and should DROP all requests from any other machine in the network. I tried IPTABLES and i'm struck & unable to proceed. Please let me know some basic rules so that i can configure iptables on all 5 machines to comply with my requirement.

regards,
vasanth
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-09-2005, 10:15 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
My distro: Debian GNU/Linux
Posts: 482
Rep Power: 5
monk will become famous soon enough monk will become famous soon enough
Default

Well rules are quite simple

Close all the doors and open the windows i.e ports.

# first it following 3 ruls will close everything
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

# Next allow unlimited traffic on both loopback
iptables -A INPUT -i lo -s 127.0.0.1 -j ACCEPT
iptables -A OUTPUT -o lo -d 127.0.0.1 -j ACCEPT

# Now open rest of the ports
# for example to open port 80 for everyone use
ip="192.168.1.5" # IP of your www service
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d $ip --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp -s $ip --sport 80 -d 0/0 --dport 1024:65535 -j ACCEPT

This the way set the rest of firewall
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Iptables nixsen CentOS / RHEL / Fedora 2 11-29-2007 04:01 PM
iptables help vitaminme Networking, Firewalls and Security 1 09-04-2007 03:42 AM
IPTABLES Help asim.mcp Linux software 3 07-08-2006 03:53 AM


All times are GMT +5.5. The time now is 06:30 AM.


Powered by vBulletin® Version 3.7.4 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36