Question: How to set static IP in OpenBSD/LibertyBSD?
Backstory: I recently purchased a *BSD VPS and have been having some issues with networking. How do I set the IP address?
Question: How to set static IP in OpenBSD/LibertyBSD?
Backstory: I recently purchased a *BSD VPS and have been having some issues with networking. How do I set the IP address?
If your network device is en0, and you want to configure it with the persistent static IP address 10.1.2.3 and the netmask 255.255.255.0, then you create /etc/hostname.en0 with the contents
inet 10.1.2.3 255.255.255.0
This will take effect upon rebooting (when /etc/netstart is run; see netstart(8)).
See also the hostname.if(5) manual, and the networking section of the OpenBSD FAQ.
en0? I believe I selected vio0 as the network interface during installation. </br> Also, do I need root access to edit etc/hostname.en0?
                
                vio0 in place of en0 in my answer. You have to be root to make changes like these, yes.  I'm not aware of any Unix that allows you to change network configuration without root access.  The system installation process should have created /etc/hostname.vio0 already (if not, you may just create it), so you just need to change its contents.
                
                
                If I recall properly try using ifconfig:
# ifconfig [network interface] inet [address] netmask [netmask]
You will need root so execute su - first.
To follow @Kusalananda's post if the address is 10.1.2.3 and the netmask 255.255.255.0 on the network interface vio0 you should be able to execute the following: 
# ifconfig vio0 inet 10.1.2.3 netmask 255.255.255.0