NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Configure NetBSD as a gateway for LAN hosts



On Oct 12, 20:07, Rocky Hotas wrote:
}
} Thanks to your suggestions for a NIC (in particular, thanks to Martin:
} Realtek worked), I configured a second NIC in a NetBSD 9.0 (release)
} machine.
} I would like to use it as a 1) gateway and 2) DHCP server, but didn't
} find much documentation as regards problem 1).

     This is a very common configuration, so there is lots of
documentation on the Internet about how to do it.  For NetBSD in
particular, take a look at the Guide:

http://www.netbsd.org/docs/guide/en/
http://www.netbsd.org/docs/guide/en/part-net.html

} IIUC, some preliminary operations are:
} 
} - put `net.inet.ip.forwarding=1' in /etc/sysctl.conf;

     Yes, you will need this, unless you have 'options GATEWAY' in
your kernel config.

} - put `gateway_enable="YES"' in /etc/rc.conf.

     I don't know what the source of this is, but it doesn't do
anything on NetBSD.

} But then I don't know how to proceed. Which is the correct approach?
} Should I use npf? I found that /usr/share/examples/npf/l2tp_gw-npf.conf

     You will need to use one of the packet filters in order to do
NAT.  The example above is overkill for your needs (l2tp is Layer
2 Tunneling Protocol and is for a specific type of incoming VPN
setup).  You would probably be better off starting with soho_gw-npf.conf
(you can delete or comment out parts that aren't applicable).  Note
that the examples in the Guide use ipfilter which will work for
now, but will likely be deleted at some point.

} Should I build a bridge? And how to configure the routing tables?

     No, assuming the standard ISP setup where you're provided with
a single IPv4 address, a bridge won't work.  See the Guide for how
to configure routing.

}-- End of excerpt from Rocky Hotas


Home | Main Index | Thread Index | Old Index