Autoconfiguring Networking

NOTE: If you are running a server, static networking is preferable to autoconfiguration. An improperly configured DHCP or rad server may cause your IP addresses to change in an unpredictable manner: a serious problem for servers.

autoconf at install

The easiest way to autoconfigure networking is to specify this when installing OpenBSD. When asked about network interfaces, specify autoconf:

Available network interfaces are: vio0 vlan0.
Network interface to configure? (name, lladdr, '?', or 'done') [vio0] 
IPv4 address for vio0? (or 'autoconf' or 'none') [autoconf] 
IPv6 address for vio0? (or 'autoconf' or 'none') [none] autoconf
Available network interfaces are: vio0 vlan0.
Network interface to configure? (name, lladdr, '?', or 'done') [done] 

Configuring hostname.if0

If you want to switch to autoconf after installation, edit hostname.if0:

# cat /etc/hostname.if0
inet autoconf
inet6 autoconf

This instructs OpenBSD to use autoconfiguration for both IPv4 (inet) and IPv6 (inet6) on the interface if0. Make sure to replace if0 with your actual interface.

Autoconfiguration relies on dhclient? and slaacd?.