I'm sorry I wasn't clearer describing my setup. It's that I tried to build up a simple situation concerning the ipf statement I had doubts about. I have the ipfilter box connected directly to the DSL modem/router and the private network connected to the private interface of the ipfilter box, through a hub. To get out to the Internet I have to set up the default gateway of the ipfilter box pointing to the ethernet connection of the DSL modem/router.

DSL modem/router = 192.168.1.1
ipfilter box "public interface" = 192.168.1.2
ipfilter box private interface = 192.168.2.1

Because of this setup, to get out through to the Internet, I have to set up the default gateway of the ipfilter box pointing to the ethernet connection of the DSL modem/router and use the ipfilter box as a router for the clients. For this reason I had to set up this rule:

pass out quick on "public interface" proto tcp/udp from 192.168.1.2/32 to any keep state
pass out quick on "public interface" proto icmp from 192.168.1.2/32 to any keep state


so the ipfilter box could see the DSL modem/router and provide a means for the clients connected to the ipfilter box to use the it to go out through to the Internet.

Jim Sandoz replied to my query and explained in a better way my setup:

(config B)

dhcp    192.168.1.1    192.168.0.1   ]----- [PC1] 192.168.0.2
--[dsl router]------[ipf box]----[hub]----- [PC2] 192.168.0.3
                192.168.1.2          ]----- [PCn]

in (B),
the dsl router terminates the DSL line, obtains a DHCP address
from your service provider, and configures a /24 network on the
LAN port.  that /24 network you use as a "transit net" -- it
only serves to get traffic between two routers, namely the ipf
box and the dsl router.  you could make the transit net a lot
smaller from a subnet mask perspective but it's not necessary
as you are using plentiful RFC1918 "private" addresses.

configuring the interface and routing on the ipf box is again
very simple; just have to deal with two intefaces and enabling
routing as well:
# ifconfig if0 192.168.1.2 netmask 255.255.255.0  # outside
# ifconfig if1 192.168.0.1 netmask 255.255.255.0  # inside
# route add default 192.168.0.1
# /usr/sbin/ndd -set /dev/ip ip_forwarding 1    # solaris syntax

the rules on the ipf box should reflect 192.168.1.2 as the outside
IP address.  the rules are a little more complicated, since the
box is now routing and also perhaps NATing as well.  you will need
to configure the ftp proxy to assist clients behind the ipf box.
on the router, if you are NOT doing NAT on the ipf box, you will
need to set up a static route so that the "hidden" 192.168.0.0/24
network can be reached by the router.  the gateway for that net,
from the router's perspective, is the ipf box (192.168.1.2).

advantages of this setup:
  -DSL router handles PPPoE and DHCP, so your ipf box addresses
   stay fixed as do your ipf rules.
  -with the ipf box in place, you can set up client access rules
   or even a transparent http proxy/cache, among other things.
  -quick recovery from ipf box problems (*see comment at end*)
disadvantages of this setup
  -ipf box must serve up DHCP addresses to clients.
  -router has to be configured to forward ports to ipf box.
  -router+ipf NAT combo sometimes perplexes interal FTP clients.
  -no network if ipf box is down.
  -there is a disk in the way of your network connectivity.

From Jim's answer I can imply that it is normal to have a rule, as I stated above, to get clients to use the ipfilter box's firewall and still pass through the DSL modem/router to go out to the Internet.

It's more clearer now.

Thanks,

Daesden


On Feb 9, 2004, at 11:51 AM, Steven Miller wrote:


perhaps I'm not understanding correctly, but shouldn't the DSL modem be
connected directly to the box with ipfilter on one interface and another
interface on that same box connected to your hub? that way the box with
ipfilter can do all the filtering and NAT'ing before anything from the
internet can hit your internal network? This setup would match the
examples you've seen. And If I understand your current setup your DSL
modem connects directly to your hub (for your internal network?) if this
is the case doesn't that open all of your internal machines directly to
the internet? thus defeating the purpose of ipfilter acting as firewall.
It merely does NAT translation leaving your internal machines to take
care of themselves. If you've intentionally set things up this way then
the scenario you've described would be the only way to make it work. .


On Sun, 2004-02-08 at 23:19, Daesden Arevir wrote:
Hello Mailing List Readers,

I've been searching the Archived Mailing List to see if a poster has
described my main doubt, found a few references, but none conclusive.

I have a DSL modem at home which my Phone Company provides. The company
provides a public ip address through DHCP to the modem and renews
leases every six hours. The modem has an Ethernet port which I connect
to a HUB and finally to my internal network.


The doubt comes when all the examples I've found assumes the IPFilter
box has a public IP address and the rules are built down from that
assumption. In my internal network setup the IPFilter box's "untrusted"
interface is connected to the hub, which connects to the ethernet port
of the modem, using a private IP address: 192.168.x.x. From my googling
and testing the only way I can use the modem to go through to the
internet is by setting on the IPFilter box the default gateway pointing
to the ethernet port of the modem. Then from there using the following
rule to let clients, connected to the "trusted" interfaces, and
IPFilter box to see the modem and pass through to the Internet.


## vr0 - 192.168.1.2, outside interface.
## 192.168.1.1, default gateway.

pass out quick on vr0 proto tcp/udp from 192.168.1.2/32 to any keep
state
pass out quick on vr0 proto icmp from 192.168.1.2/32 to any keep state

Is this a normal rule to have in an ipfilter firewall, according to my
setup? Is there a better way? Is my setup limiting a proper ipfilter
firewall?

Thanks for your attention,

Daesden




Reply via email to