On Wed, 2007-11-21 at 15:42 -0800, Tom Eastep wrote:
> 
> I guess it makes sense in a way. You want a zone that is defined as "all
> external hosts that communicate through a particular firewall interface
> using a particular address on that interface". You are not the first to
> want to do something like that so it may be something to consider for
> Shorewall 4.2.
> 
> It would require some sort of magic in the hosts file such as:
> 
>       net0    eth0:0.0.0.0/0  address=<local ip address>, ...
> 
> I'll see what I can come up with.

This idea quickly turns sticky. A zone as contemplated, seems of little
practical use except for fw <-> zone rules and policies. 

Suppose I have:

/etc/shorewall/zones:

        fw      firewall
        net1    ipv4
        net2    ipv4
        loc     ipv4

/etc/shorewall/interfaces:

        -       eth0    ...
        loc     eth1    ...

/etc/shorewall/hosts:

        net1    eth0:0.0.0.0/0  local=206.124.146.176,...
        net2    eth0:0.0.0.0/0  local=206.124.146.177,...

Consider this rule:

        DNAT    net1    loc:192.168.1.4 tcp     80

That would appear to require that the ORIGINAL DEST column default to
206.124.146.176 because that is the local address of net1. If fact, that
seems like the only possible legitimate value for ORIGINAL DEST as well.

What does this rule mean?

        ACCEPT  net1    loc     all

Or this one?
        
        ACCEPT  loc     net1    all

How is the local address relevant in that rule? Does it mean that all
traffic from eth1 through eth0 should be SNATted with the local address
of net1? Should the local address simply be ignored?

How about this entry in /etc/shorewall/masq?

        eth0    eth1    206.124.146.177

And how does it impact the previous rule. Does it mean that loc->net1
connections are essentially impossible with those two entries?

The way that I would deal with Eric's problem today would be as follows:

/etc/shorewall/params:

        IP1=206.124.146.176
        IP2=206.124.146.177

        FW1=fw:206.124.146.176
        FW2=fw:206.124.146.177

Then I can have rules:

        ACCEPT  net     $FW1            tcp     22
        ACCEPT  net     loc             all
        DNAT    net     loc:192.168.1.4 tcp     80      -       $IP1

and in /etc/shorewall/masq:

        eth0    eth1    $IP2

And the meaning of each entry is clear and unambiguous. On the other
hand, it appears that defining clear and unambiguous semantic behavior
for the 'local' address in a host entry would be difficult.

-Tom
-- 
Tom Eastep    \ Nothing is foolproof to a sufficiently talented fool
Shoreline,     \ http://shorewall.net
Washington USA  \ [EMAIL PROTECTED]
PGP Public Key   \ https://lists.shorewall.net/teastep.pgp.key

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to