Hello *,
I need to create a point-to-point connection to my gateway. From my provider, 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).
Wiki-article:
http://wiki.hetzner.de/index.php/Net...int_connection
Hereunder my file /etc/sysconfig/network-scripts/ifcfg-eth0 (as describer in the Wiki)
Code:
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 (as describer in the Wiki)
Code:
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":
Code:
link-local * 255.255.0.0 U 1002 0 0 eth0
After some search, I edit the file /etc/sysconfig/network as below:
Code:
NETWORKING=YES
HOSTNAME=server.domain.lan
GATEWAYDEV=eth0
An error appears: "RTNETLINK answers: File exists".
The output of command "route":
Code:
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":
Code:
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,