Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptable rules for two networks connected with two firewalls

Reply
Thread Tools Display Modes

iptable rules for two networks connected with two firewalls

 
 
andreas.sachs@gmail.com
Guest
Posts: n/a

 
      06-10-2007, 10:11 PM
Hello,
i'm looking for iptable rules to solve a problem with asymmetric
routing.

I have two networks (NET-A, NET-B). The networks are connected with
two parallel firewalls. Lets say, NET-A is connected to eth0 on each
firewall, NET-B is connected to eth1.

A B
| |
|---FW1--|
| |
|---FW2--|
| |


Clients on NET-B are not allowed to initiate connections to NET-A.
CLients on NET-A are allewed to connect to hosts on NET-B.

Normally i would do this that way (Default is DROP):

iptables -I FORWARD -i eth0 -o eth1 -j ACCEPT
iptables -I FORWARD -i eth1 -o eth0 -j ACCEPT -m state --state
ESTABLISHED

This works as long as the packtes coming back from NET-B to NET-A go
throuh the same firewall. But if the routing is asymmetric the packets
will be NEW and not ESTABLISHED for the second firewall.

Is there a posibility to solve my problem for tcp (maybe with syn-
flag?)?
or for tcp and udp?

Thanks Andreas

 
Reply With Quote
 
 
 
 
Oliver Joa
Guest
Posts: n/a

 
      06-11-2007, 07:14 AM
Hi,

On Sun, 10 Jun 2007 15:11:44 -0700, andreas.sachs wrote:

[...]

> A B
> | |
> |---FW1--|
> | |
> |---FW2--|
> | |
>
>
> Clients on NET-B are not allowed to initiate connections to NET-A.
> CLients on NET-A are allewed to connect to hosts on NET-B.
>
> Normally i would do this that way (Default is DROP):
>
> iptables -I FORWARD -i eth0 -o eth1 -j ACCEPT
> iptables -I FORWARD -i eth1 -o eth0 -j ACCEPT -m state --state
> ESTABLISHED
>
> This works as long as the packtes coming back from NET-B to NET-A go
> throuh the same firewall. But if the routing is asymmetric the packets
> will be NEW and not ESTABLISHED for the second firewall.
>
> Is there a posibility to solve my problem for tcp (maybe with syn-
> flag?)?
> or for tcp and udp?


yes, you can check for syn-flag. it is similar like to check for
state-new. and !syn-flag is similar to state-established. but you will not
get complex protocols like ftp. it will not be a real stateful firewall,
but possible. for udp you have to check all packets, go and goback, there
is no syn-flag...

olli
 
Reply With Quote
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iptable rules not being hit R C V Linux Networking 4 04-15-2008 12:22 PM
IPSec policy on servers connected to 2 networks Stuart Windows Networking 2 11-20-2007 02:59 PM
One computer connected to two networks, simultaneously techenthusiast Windows Networking 2 09-08-2006 05:45 PM
Routing between to networks connected via VPN runningdog Windows Networking 3 03-30-2005 10:55 PM
Available networks: none? while connected! -=outlaw=- Wireless Internet 1 04-07-2004 05:06 AM



1 2 3 4 5 6 7 8 9 10 11