To configure an access point as a router:
Say we want our wireless network to advertise MY_WIRELESS_NET, and our WEP secret is MYWIRELESSWEP. We have to do the following:
#sysctl -w net.inet.ip.forwarding=1
#ifconfig in_nic mediaopt hostap
#ifconfig in_nic ssid MY_WIRELESS_NET nwkey MYWIRELESSWEP
#ifconfig in_nic 10.42.0.1 up
subnet 10.42.42.0 netmask 255.255.255.0 { range 10.42.0.2 10.42.0.120; ...; }
Then you run dhcpd:
#dhcpd -cf full_path_to_your_dhcp_config_file -lf \ full_path_to_your_release_file ni_nic
You don't need to specify where your dhcpd.conf and release file are if you put them in the default place under /etc. For more information, see the entry for dhcpd in the Utilities Reference.
To use WPA or WPA2, you need to set up and run hostapd (the server-side application associated with the client's wpa_supplicant) to do the authentication and key exchange for your network.
You can also configure your access point as a NAT network router as follows:
#mount -Ttcpip lsm-pfv4.so
so that the PF module is loaded, and then use pfctl to do the configuration.
For details of how to configure a NAT, visit http://www.netbsd.org/docs/.