IP configuration on OpenBSD online.net (aka Dedibox)
Posted on April 3, 2011
Dedicated servers providers like Online.net are now proposing to address Virtual Machines by using static mac, but the configuration is not 100% “clean” on quite a few OS (see my upcoming post on how it works).
Hopefully, it’s pretty straightforward on OpenBSD, let’s assume $if is the interface connected to the Public Network , 88.190.xxx.xxx is the IP address (also called FailOver IP) given by your provider and 126.96.36.199 is the gateway.
When installing OpenBSD you can configure the IP of the device as a /32 without any problems, but when it comes to configuring the gateway it won’t work. Why? Because OpenBSD is (rightly) expecting to have the gateway on the same subnet so we have to work our way around that.
In the installation process, after configuring the network you have an option to make extra configs at the shell prompt, that’s our way out!
First of all configure the IP address of the interface:
ifconfig em0 inet 88.190.xxx.xxx netmask 255.255.255.255
If you try to ping the gateway it will fail as it’s not on the same subnet, so we need to tell OpenBSD how to reach this IP, to do this we’ll configure OpenBSD so that it will ARP for that IP on it’s external interface:
route add -inet 188.8.131.52/32 -link -iface $if
Lets try to ping the gateway …
# ping 184.108.40.206 PING 220.127.116.11 (18.104.22.168): 56 data bytes 64 bytes from 22.214.171.124: icmp_seq=0 ttl=255 time=0.551 ms 64 bytes from 126.96.36.199: icmp_seq=1 ttl=255 time=0.418 ms 64 bytes from 188.8.131.52: icmp_seq=2 ttl=255 time=0.463 ms 64 bytes from 184.108.40.206: icmp_seq=3 ttl=255 time=0.483 ms --- 220.127.116.11 ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.418/0.478/0.551/0.054 ms
… and it works!
We just need to setup the gateway and finish our setup.
Now we want to make sure the interface starts at boot time, to do this we’re just going to create the file
/etc/hostname.$if with the following content:
inet 88.190.xxx.xxx 255.255.255.255 !route add -inet 18.104.22.168/32 -link -iface $if
and populate the file /etc/mygate with the IP of the gateway
Here we are, OpenBSD is running in the virtual world but connected to the real world!