I'm going to gather here my notes on setting up network interfaces under OpenBSD.
openbsd# ifconfig
address_family address netmask broadcast [other options]
openbsd# ifconfig
lo0: flags=2008049<UP,LOOPBACK,RUNNING,MULTICAST,LRO> mtu 32768
index 5 priority 0 llprio 3
groups: lo
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
inet 127.0.0.1 netmask 0xff000000
vmx0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
lladdr 00:50:56:1a:b0:11
index 1 priority 0 llprio 3
groups: egress
media: Ethernet autoselect (10GbaseT)
status: active
inet 192.168.1.10 netmask 0xffffff00 broadcast 192.168.1.255
openbsd# cat /etc/hostname.vmx0
inet 192.168.1.10 255.255.255.0 NONE
openbsd# echo "192.168.1.1" > /etc/mygate
openbsd# echo "dhcp" > /etc/hostname.em0
inet 192.168.1.2 255.255.255.0 NONE
inet 172.21.0.31 255.255.255.0 NONE vlan 10 vlandev em1
openbsd# echo "gateway.std.rocks" > /etc/myname
openbsd# echo "nameserver 192.168.1.254" > /etc/resolv.conf
search example.com
nameserver 125.2.3.4
nameserver 125.2.3.5
#file will look for entries in /etc/hosts
#bind will request them from the name servers.
#In this case, the order would be: search in /etc/hosts, then request to DNS servers.
lookup file bind
openbsd# sh /etc/netstart
Contact :