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.

I'm having issues routing traffic thru VPN.

Here's my setup

I have 3 hosts, let's call them A, B and Z

B and Z have a VPN connection in the 10.10.10.x SUBNET A and B have a direct connection in the 10.10.12.x SUBNET

I want to be able to route traffic from A to Z, like :

A <= 10.10.12.254 [LAN] 10.10.12.111 => B <= 10.10.10.152 [VPN] 10.10.10.10 => Z

On host B, i have set up ip_forwarding : net.ipv4.ip_forward = 1

and routing on host B:

[root@hostB: ~]# ip route
10.10.10.10 dev ppp0  proto kernel  scope link  src 10.10.10.152 
10.10.12.0/24 dev eth1  proto kernel  scope link  src 10.10.12.111 
10.10.10.0/24 dev ppp0  scope link 
169.254.0.0/16 dev eth1  scope link 

routing on host A:

[root@hostA: ~]# ip route
10.10.10.0 via 10.10.12.111 dev eth1 
10.10.12.0/24 dev eth1  proto kernel  scope link  src 10.10.12.254 
169.254.0.0/16 dev eth1  scope link 
default via 192.168.1.1 dev eth0

But still not able to ping 10.10.10.10 from host A.

Any idea ? I'm pulling my hairs out.

share|improve this question
1  
At first glance, theres no netmask for the route to 10.10.10.0/24, or 10.10.10.10/32? Also please supply routing table for host Z, and ifconfigs (please ensure the IP addresses you paste are obfuscated) –  Sirch Jun 18 '12 at 9:26
1  
@Disco, please do not crosspost questions between Stack Overflow and Server Fault –  Mike Pennington Jun 18 '12 at 11:00
    
Are you running iptables on any of the machines? –  sonassi Jun 20 '12 at 21:52
    
@Disco, have you solved the problem? What is the networking configuration on Z? –  Mike Pennington Jun 25 '12 at 9:55
add comment

2 Answers

On Z, assuming 10.10.10.10 is on ppp0:

route add -net 10.10.12.0 netmask 255.255.255.0 gw 10.10.10.152 dev ppp0

This will give you a return route to A

share|improve this answer
add comment

Like mike said... You need two routes... On A ---> Z and viceversa... On Z ---> A.... If you miss just one of them, they won't be able to comunicate each other, because the packets don't know the route to go back to the source... So you need to do something like this on A and Z...

On Z route add -net 10.10.12.0 netmask 255.255.255.0 gw 10.10.10.152 dev ppp0

On A route add -net 10.10.10.0 netmask 255.255.255.0 gw 10.10.12.111 dev ppp0

Let us know!!!

share|improve this answer
    
Well; there's no ppp0 device on A; ppp0 is on B –  Disco Jul 13 '12 at 14:47
add comment

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.