help with ipfw

Nathan Kinkade nkinkade at
Wed Feb 25 06:49:59 PST 2004

On Wed, Feb 25, 2004 at 10:58:32AM +0100, stefan at wrote:
> Hi
> I've setup a box here to act as a router/firewall for a bunch of
> servers that will be behind it. Both nics seem to respond nicely but
> only the first one thats connected to the outside was able to be
> configured from sysinstall the second one thats connected to a, right
> now empty, switch i had to set myself with ifconfig dc0 inet <ip> but
> i need to set gateway and so on for it. Where can i do this?  Also, if
> it now IS correctly configured, how come it wont route packets? I
> hooked up the office wlan to it and set an allow any to any rule but
> it still wont work.
> Med vänliga hälsningar
> Stefan Midjich, Swebase AB

To set a default gateway, you can issue the follwing command:

# route add default <gateway ip address>

To make sure it gets set on each reboot you define a default gateway in
your /etc/rc.conf file with a line like:

defaultrouter="<some ip address>"

If you want the machine to act as a router then you need to turn on
ip forwarding.  You can do this immediately by issuing the following

# sysctl net.inet.ip.forwarding=1

... and then you can add the following line to /etc/rc.conf to make sure
that this sysctl is set on each reboot:


gpg --keyserver --recv-keys D8527E49
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-questions mailing list