Static Route Problem

Issues related to configuring your network
Post Reply
Maning
Posts: 2
Joined: 2017/07/09 11:51:53

Static Route Problem

Post by Maning » 2017/07/09 12:05:24

I have to servers in the same gateway and I am trying to create a static route.
Both ping gateway but can not ping each other, I have tried a lot but I didn't manage to find a solution!
I attach information for both servers:

192.168.1.3

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1   	0.0.0.0         UG    0      0        0 eth0
192.168.1.0   	0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.1.1   	0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.1.50  	0.0.0.0         255.255.255.255 UH    0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.3  netmask 255.255.255.255  broadcast 192.168.1.3
        ether 90:1b:0e:a3:c3:16  txqueuelen 1000  (Ethernet)
        RX packets 1241  bytes 286106 (279.4 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1434  bytes 653612 (638.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xf7000000-f7020000

eth0:cp1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.50  netmask 255.255.255.0  broadcast 192.168.1.255
        ether 90:1b:0e:a3:c3:16  txqueuelen 1000  (Ethernet)
        device interrupt 16  memory 0xf7000000-f7020000

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1  (Local Loopback)
        RX packets 1214  bytes 204661 (199.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1214  bytes 204661 (199.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

route-eth0
ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=192.168.1.1

ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.1.3
NETMASK=255.255.255.255
SCOPE="peer 192.168.1.1"

192.168.1.4

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1   	0.0.0.0         UG    0      0        0 eth0
192.168.1.0  	0.0.0.0         255.255.255.192 U     0      0        0 eth0
192.168.1.1   	0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.1.56  	0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.1.57  	0.0.0.0         255.255.255.255 UH    0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.4  netmask 255.255.255.255  broadcast 192.168.1.4
        ether 90:1b:0e:a3:c3:2f  txqueuelen 1000  (Ethernet)
        RX packets 64612557  bytes 8691693686 (8.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 115568642  bytes 165438119561 (154.0 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xf7000000-f7020000

eth0:cp1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.56  netmask 255.255.255.192  broadcast 192.168.1.63
        ether 90:1b:0e:a3:c3:2f  txqueuelen 1000  (Ethernet)
        device interrupt 16  memory 0xf7000000-f7020000

eth0:cp2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.57  netmask 255.255.255.192  broadcast 192.168.1.63
        ether 90:1b:0e:a3:c3:2f  txqueuelen 1000  (Ethernet)
        device interrupt 16  memory 0xf7000000-f7020000

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1  (Local Loopback)
        RX packets 2201272  bytes 401472000 (382.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2201272  bytes 401472000 (382.8 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

route-eth0
ADDRESS0=0.0.0.0
NETMASK0=0.0.0.0
GATEWAY0=192.168.1.1

ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
IPADDR=192.168.1.4
NETMASK=255.255.255.255
SCOPE="peer 192.168.1.1"
Any help will be appreciated :D

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Static Route Problem

Post by jlehtone » 2017/07/09 18:24:51

Maning wrote:I have to servers in the same gateway
What do you have, exactly? Logically? Physically?

Do you have, or should you have, one (logical) subnet that has (at least) three devices?

"In the gateway" sounds like you opened the cover of a commodity router and squeezed two PC's inside it, doesn't it?

Whoever
Posts: 1361
Joined: 2013/09/06 03:12:10

Re: Static Route Problem

Post by Whoever » 2017/07/09 19:42:43

What's this doing in the routing tables?

Code: Select all

192.168.1.1      0.0.0.0         255.255.255.255 UH    0      0        0 eth0

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Static Route Problem

Post by TrevorH » 2017/07/09 21:10:37

The whole set up is odd. First the primary ip address on eth0 is 192.168.1.3/255.255.255.255 then there's an alias added on top of that with a different netmask. Then there's an explicit route set for everything via 192.168.1.1 which isn't even reachable via the primary ip address since it's netmask doesn't let it get there.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Maning
Posts: 2
Joined: 2017/07/09 11:51:53

Re: Static Route Problem

Post by Maning » 2017/07/12 07:59:57

jlehtone wrote:
Maning wrote:I have to servers in the same gateway
What do you have, exactly? Logically? Physically?

Do you have, or should you have, one (logical) subnet that has (at least) three devices?

"In the gateway" sounds like you opened the cover of a commodity router and squeezed two PC's inside it, doesn't it?
It was typo, I mean two servers!

There is a subnet with a lot of devices!
TrevorH wrote:The whole set up is odd. First the primary ip address on eth0 is 192.168.1.3/255.255.255.255 then there's an alias added on top of that with a different netmask. Then there's an explicit route set for everything via 192.168.1.1 which isn't even reachable via the primary ip address since it's netmask doesn't let it get there.
Unfortunately this is Hetzner's default configuration :?

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Static Route Problem

Post by jlehtone » 2017/07/12 10:46:44

Maning wrote:There is a subnet with a lot of devices!

Unfortunately this is Hetzner's default configuration :?
If you would have a subnet that has multiple devices, then those devices
would not have prefix 32, like you have shown. All your addresses look like
192.168.1.x/32 and that means that they are all in different subnets.

Lets say that the (Hetzner) router 192.168.1.1 is A.
Your first server B uses A as default route to everyone else.
Your first server C uses A as default route to everyone else.

The B and C are not on the same subnet. The only way for either to reach
anyone, including the other, is via A. If A does not do it for you, then it does not.

It is completely plausible that the Hetzner router isolates each client from other clients.
B and C look like separate clients.


If you had two servers and a router all connected to a switch, then your current network config would be worse than "odd".

However, this routing task does not look to be your problem. It is a Hetzner problem. They should assist you to implement the functionality that you need. Their network. Their rules. Their responsibility.


PS. I don't actually know what this "Hetzner" is.

Post Reply