LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-04-2014, 06:58 AM   #1
Bob.Sauvage
LQ Newbie
 
Registered: Aug 2014
Posts: 3

Rep: Reputation: Disabled
Kind of Point-to-Point connection


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,
 
Old 08-04-2014, 02:38 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
route-interface file has two formats: IP command arguments and network/netmask directives. You can try IP command argumemts to define device.

IP Command Arguments Format

Define a default gateway on the first line.

default X.X.X.X dev interface
 
Old 08-05-2014, 08:02 AM   #3
Bob.Sauvage
LQ Newbie
 
Registered: Aug 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks but I've already tried...

In this case, this error appears:

Error: either "to" is duplicate, or "192.168.1.254" is a garbage.
 
Old 08-05-2014, 02:49 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
I use network manager to config host interface, mask is 255.255.255.255. Everything is fine, be able to ping default gateway.
No /etc/sysconfig/network-scripts/route-eth0
No /etc/sysconfig/network
Only /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR0=192.168.1.10
PREFIX0=32
GATEWAY0=192.168.1.254
 
Old 08-06-2014, 05:50 AM   #5
Bob.Sauvage
LQ Newbie
 
Registered: Aug 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
I deleted files route-eth0 & network. I've configured ifcfg-eth0 like you said (I had to add DEVICE=eth0) and it doesn't work...

[root@xxx network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Determining if ip address 192.168.1.1 is already in use for device eth0...
[ OK ]
[root@xxx network-scripts]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
link-local * 255.255.0.0 U 1002 0 0 eth0
[root@xxx network-scripts]# ping 192.168.254
connect: Network is unreachable

Which distribution are you using ?
 
Old 08-07-2014, 02:40 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,850

Rep: Reputation: 161Reputation: 161
I am using Fedora 20. Do you have network manager in your distribution? It is better to use network manager to configure interface. Anyway, I attach my ifcfg-p4p1.

TYPE="Ethernet"
BOOTPROTO=none
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="p4p1"
UUID="xxxxxx"
ONBOOT="yes"
IPADDR0=192.168.1.10
PREFIX0=32
GATEWAY0=192.168.1.254
HWADDR=xxxxxxxxx
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Implement Low Speed Point-to-Point Data Link via Linux networking? Paul_N Linux - Networking 2 06-30-2013 03:47 PM
USB mount point is not shown in /dev entry point garryhk Linux - Software 3 12-12-2012 05:28 PM
Gnome Desktop makes 10 point font look like 64 point - how do I fix it? TonyC Linux - Desktop 5 03-03-2009 12:22 AM
LXer: Set up a SSH-based point to point connection LXer Syndicated Linux News 0 11-30-2008 09:50 PM
telnet not work in Point to Point connected FC6 boxes techteacher Linux - Networking 4 05-06-2007 09:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration