Static IPs and default route on 1und1 CentOS 5 Servers
I’ve been experiencing some serverdowns at a client who uses 1und1 CentOS 5 Servers. After some investigation I discovered that cronjobs were still running although the server appeared to be down. Checking the syslogs showed me a bunch of failed DHCP requests which remebered me of the fact that 1und1 uses DHCP to configure the server machines. I don’t think this is a good idea so I changed the setup to static IPs.
Since 1und1 puts every server behind a dedicated firewall the setup is not as easy as you think. I’ll document it here because It may be useful for other people and certainly for myself after a couple of months.
Configure a static IP address
Open the file /etc/sysconfig/network-scripts/ifcfg-eth0 and edit it to look like the following:
DEVICE=eth0 BOOTPROTO=none TYPE=Ethernet ONBOOT=yes HWADDR=$YOURMACADDRESS NETMASK=255.255.255.255 IPADDR=$YOURIP GATEWAY=10.255.255.1
Save the file.
Configure static routes
This is the tricky part. Configuring a default gateway using the GATEWAY= setting is not enough. You have to setup the routes yourself. To do so create a new file /etc/sysconfig/network-scripts/route-eth0 with the following contents:
10.255.255.1 dev eth0 default via 10.255.255.1 dev eth0
Now you only have to reload the networking configuration via
service network reload
and you are done!
This post helped me a lot with the solution.

March 20th, 2009 at 3:15 am
This was very handy. I have servers at 1und1 also, and an ISP that I do work for on occasion asked if we could do something like this on his client network.
Thanks!
March 20th, 2009 at 10:07 am
Hi,
I’m glad to hear the post was helpful. Thanks very much for letting me know. This is always very encouraging.
Best regards,
Sebastian