Configure network interfaces on OpenBSD
Intro
Configuration
Installing
We need to create a /etc/hostname."interface_name" file for each interface, contening this information :
address_family address netmask broadcast [other options]
Settings
-
dhcp : put the interface in dhcp mode
-
address_family : inet for IPv4
-
address : ip address
-
netmask : network mask
-
NONE : No broadcast address
Examples
# echo "192.168.1.1" > /etc/mygate
-
Set em0 interface in dhcp :
# echo "dhcp" > /etc/hostname.em0
-
Set em1 interface in static :
inet 192.168.1.2 255.255.255.0 NONE
-
Set a vlan10 interface on em1 interface :
inet 172.21.0.31 255.255.255.0 NONE vlan 10 vlandev em1
-
To take this changes into consideration we need to execute :
# sh /etc/netstart