Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-30-2009, 01:05 AM   #1
LQ Newbie
Registered: Mar 2009
Posts: 5

Rep: Reputation: 0
Unhappy iptables rules


I have some problems in writing iptables rules .I setup ubuntu gateway server.My configurations are given below
eth0 : is connected to the local network
eth1 : is connected to the internet
eth2 : is connected to another network
eth3 : is connected to another network

Here I designed network for servers. In this network, many local services are running .So other & network should connect to the network and viceversa. But I dont want to connect network to the network and viceversa.In my configuration network, is gateway and for network, is gateway and for network, is gateway.I tested all gateways and all are working fine.But problem is with the intercommunication of the networks.I dont want to communicate to network and viceversa.

I wrote iptables rules but it is not completely successful.I tried to block icmp protocol.

Please anyone help me to solve this problem.

Last edited by sajina; 03-30-2009 at 01:07 AM.
Old 03-30-2009, 01:27 AM   #2
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
You need to clarify your network policies. All these numbers don't help.
State your rules in terms of packets and pick reasonable variable names for your networks.

In order, you have LAN, inet, net3, net4 ... fine.

the LAN net has many servers. The server we are configuring sits between networks.

packets from net3 and net4 must be able to reach LAN (and reverse)
packets must not flow between net3 and net4
- packets from net3 addressed to net4 are dropped
- packets from net4 addressed to net3 are dropped
- packets from net3 to LAN are allowed
- packets from net4 to LAN are allowed

eth0 traffic to the internet goes to eth1.
eth2 traffic to the internet goes to eth1
eth3 traffic to the internet goes to eth1
... you can do this with port forwarding etc.

the gateway addresses are only important to hosts on the various networks.
Old 03-31-2009, 09:39 PM   #3
LQ Newbie
Registered: Mar 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Wink thanks


Thank you for replaying to this doubt.

Old 03-31-2009, 10:45 PM   #4
Simon Bridge
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
I hope this turns out useful.
I am assuming you can issue iptables commands and understand the language used in the various documents and howtos. The trick is to fit your own ideas of what needs to be done with the language of security being used by those documents and the iptables commands themselves.
Once that is done, the answer is usually pretty clear cut.

But it may not be - if you get confused anywhere, just let us know.


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
About iptables rules satimis Linux - Security 11 08-27-2007 04:50 AM
iptables 1.27a still loading rules after installing iptables 1.3.0 yawe_frek Linux - Software 1 06-07-2007 09:50 PM
Help with iptables rules rejeep Linux - Security 3 04-04-2007 05:15 AM
where are my new iptables-rules? xpucto Fedora 4 03-21-2007 07:42 AM
IPTABLES - rules in /etc/sysconfig/iptables The_JinJ Linux - Newbie 6 11-20-2004 01:40 AM

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

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