1

My servers are hosted at Hetzner and I need to create a point-to-point connection to my gateway. The server can only reach its gateway (and its locally configured) IP addresses directly. All other packets need to be routed via the default gateway. Consequently, a /32 network needs to be set up (for reasons of network security).

Hetzner's wiki-article: http://wiki.hetzner.de/index.php/Netzkonfiguration_CentOS/en#Configuring_a_point-to-point_connection

Hereunder my file /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=00:1E:45:ZZ:34:F9
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.1
NETMASK=255.255.255.255

Hereunder my /etc/sysconfig/network-scripts/route-eth0 file

ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=192.168.1.254

I restart the network: service network restart

An error appears: "RTNETLINK answers: No such Process".

The output of command "route":

link-local * 255.255.0.0 U 1002 0 0 eth0

After some search, I edit the file /etc/sysconfig/network as below:

NETWORKING=YES
HOSTNAME=server.domain.lan
GATEWAYDEV=eth0

An error appears: "RTNETLINK answers: File exists".

The output of command "route":

link-local * 255.255.0.0 U 1002 0 0 eth0
default    * 0.0.0.0     U 0    0 0 eth0

Ping to the default gateway was OK. Ping to the outside was NOK !

The only way to succeed was to manually add a "second" default route:

route add default gw 192.168.1.254 eth0

The output of command "route":

link-local *               255.255.0.0 U  1002 0 0 eth0
default    *               0.0.0.0     U  0    0 0 eth0
default    static.254.1.16 0.0.0.0     UG 0    0 0 eth0

In fact, the file route-eth0 is not needed. If I delete it, no more error during the restart.

How could you explain that ?

Is there another way to succeed ? Is this method correct ?

The problem is that when I'm disconnecting/reconnecting the network interface, the route is not automatically added...

Thanks,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.