How to Set Static IP on OpenBSD

· #openbsd

It’s easy to set a static IP on OpenBSD.

First, you need to choose which interface you will set the static IP to.

$ ifconfig

Example, i will choose urtwn0.

	lladdr 7c:c2:c6:0c:fd:89
	index 4 priority 4 llprio 3
	groups: wlan egress
	media: IEEE802.11 autoselect (OFDM54 mode 11g)
	status: active

Create a new file with a formatted hostname.(interface you choose)

$ doas nvim /etc/hostname.urtwn0

Write your preferred IP.

inet 0xffffff00

Set new gateway if you dont have.

$ doas echo >> /etc/mygate

Then, apply the changes madeor it will not work.

$ doas ksh /etc/netstart

Questions or comments? email me.