Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here are these Linux and IP:

  • LinuxA: eth0 188.9.5.2, tun0 10.0.0.1
  • LinuxB: eth0 188.8.6.3, tun0 10.0.0.2
  • LinuxC: eth0 188.9.7.4
  • LinuxD: eth0 10.62.8.5

On LinuxA, I can ping to 10.0.0.2 of LinuxB.

On LinuxB, I can ping to 10.0.0.1 of LinuxA.

On LinuxA, I have enabled these:

/proc/sys/net/ipv4/ip_forward = 1
/proc/sys/net/ipv4/conf/tun0/forwarding = 1

On LinuxC, I add route as this:

route add -net 10.0.0.0 netmask 255.255.255.0 gw 188.9.5.2

And confirm LinuxC can ping to both 10.0.0.1 and 10.0.0.2

On LinuxD, however, I get this error "SIOCADDRT: Network is unreachable" when execute the route add command used on LinuxC (Note, LinuxD can ping to 188.9.5.2).

Please can someone help me on this route / gateway problem?

@dmourati, thanks for the reply. These 4 Linux are all in private network, though the 188.x.x.x IP are not of private IP range as per RFC (will be migrated soon).

share|improve this question

2 Answers 2

It appears that Linux D has only an RFC 1918 private address. Therefore, Linux D will not be able to reach 188.9.5.2 directly.

EDIT

I suggest putting all the servers into RFC 1918 address space or all on a public network. Once you have that sorted, revisit the tunnel/routing issue you raised initially.

share|improve this answer

LinuxD cannot connect to Linux C directly with that address. You could create a virtual interface on LinuxC and LinuxD as part of the same /30 subnet and pass the traffic over that. You would need another route on each device that needed to communicate with it.

There seems like there's an easier way to do this, are they all on the same Layer2? Could you possibly just create virtual devices on each and put them on the same network? If you're attempting to use the TUN adapters as virtual's off a physical you're better off using eth0:0 eth0:1 adapters.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.