IP configuration on OpenBSD with online.net (aka Dedibox)
Posté par Remi Philippe @ 16:36

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 88.190.17.1 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 88.190.17.1/32 -link -iface $if

Lets try to ping the gateway …

# ping 88.190.17.1                                                      
PING 88.190.17.1 (88.190.17.1): 56 data bytes
64 bytes from 88.190.17.1: icmp_seq=0 ttl=255 time=0.551 ms
64 bytes from 88.190.17.1: icmp_seq=1 ttl=255 time=0.418 ms
64 bytes from 88.190.17.1: icmp_seq=2 ttl=255 time=0.463 ms
64 bytes from 88.190.17.1: icmp_seq=3 ttl=255 time=0.483 ms
--- 88.190.17.1 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 88.190.17.1/32 -link -iface $if

and populate the file /etc/mygate with the IP of the gateway

88.190.17.1

Here we are, OpenBSD is running in the virtual world but connected to the real world!

Fáilte

photo Remi Philippe

The blog of a geek interested in photography and aiming for a top MBA. The idea of this blog is to share a few things: my certification related work, photography, information on the service providers infrastructures, my thoughts on business and finally my preparation for an MBA. I hope you'll find this interesting and feel free to drop me a line for any comments.

About me ...

It's somewhere here ...

Follow the white rabbit

Computer Blogs - Blog Catalog Blog Directory

Socialize

View Rémi Philippe's profile on LinkedIn

Google+