This article details the process of configuring a static IPv4 and IPv6 address on OpenBSD machines hosted with IONOS. It is assumed that the IP addresses you wish to use have already been assigned to your server via the Cloud Panel or IONOS Control Panel, and that you can access the command-line.
This configuration will work for both Cloud Servers and Dedicated Servers (both BMC and legacy).
- Determine the name of your network interface. You can run
ifconfigto find it, or look through
/etc/hostname.INTERFACEwith the contents below, replacing the parts in red with your IPs and interface, respectively. You may use
vi, or your preferred editor.
You will need to replace
INTERFACEwith the exact name of your network interface. (Ex. for
vmx0, the file would be
The IPv6 section may be omitted, if you do not wish to use IPv6.
#IPv4 inet IPV4 255.255.255.255 !route add -inet 10.255.255.1 -llinfo -link -static -iface INTERFACE !route add -inet default 10.255.255.1 #IPv6 inet6 alias IPV6/128 !route add -net ::/0 fe80::1%INTERFACE
- Reboot the system. You may run
rebootfrom the command-line, or select the reboot option in your Cloud Panel or IONOS Control Panel.
- Your server should now have the addresses you have set. You can confirm this by checking the output of
If you are not able to connect to your server after performing these changes, there are alternate ways to access your server. For Cloud Servers and dedicated servers (BMC), you may use the KVM/VNC console from your Cloud Panel.
For Legacy Dedicated servers, you may use the serial console, also known as SerCon, to log into your server for troubleshooting.