1. Store
  2. Apps
  3. Hardware
  4. Support
  5. Solutions

ClearFoundation

Forums
Welcome, Guest
SITE to SITE with OpenVPN working..sort of
(1 viewing) 1 Guest
Go to bottomPage: 123
TOPIC: SITE to SITE with OpenVPN working..sort of
#42502
SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
I have searched for months trying to find enough info to get this working but I am now as far as I can go without help.

The scenario is simple 2 ClearOS boxes connected to each other with OpenVPN.

On both servers I can successfully fire up "openvpn -config /blah/blah/blah.ovpn" they connect and I know it's up because I can ping from "putty / the console" to the corresponding lans on the far end and if I check "netstat -rn" I see the routes that OpenVpn is pushing.

The Problem--
Computers on the respective lans cannot ping IPs on the corresponding far end. I have tried adding routes to eth1 (my lan) telling it "192.168.x.0/24 via 10.8.x.5 via tun1" and I don't understand why that doesn't fix it or why the route pushed by OpenVPN isn't enough. I have also tried other variations (changing the via and dev) of the route on all interfaces to no avail.


Much obliged to any and all who help!!
Chris Fisher
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42532
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
Where is 10.8.x.5? Is it the furthest OpenVPN point that your local LAN knows about - i.e. effectively the ClearOS box at the other end?

What is the route command you are using. I think it should be something like:
Code:

route add -net 192.168.x.0 netmask 255.255.255.0 gw your_remote_OpenVPN_IP_address

I don't think you need to specify the interface (e.g. "dev tun1" or "dev tun0")

What is the output to "route -n"?
Nick Howitt
Platinum Boarder
Posts: 4150
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42546
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
The 10.8.x.5 is the OpenVPN address for the "client" box as assigned by the other box.

As far as route command I was just adding routes manually in "/etc/sysconfig/networking-scripts/" and then cycling the interfaces.

I just tried adding the route as you suggested and got an affirmative "File exists" but unfortunately I still couldn't ping the far end from pc's in the "client" box's local lan. The strange part to me is that the "client" box itself can ping IPs on the the far end.
Chris Fisher
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42558
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
From ClearOS can you give the result of a "traceroute" to a far LAN IP?
Nick Howitt
Platinum Boarder
Posts: 4150
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42562
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
192.168.36.24 = a device on the far end lan
10.36.0.1 = OpenVPN server on far end box


traceroute 192.168.36.24
traceroute to 192.168.36.24 (192.168.36.24), 30 hops max, 40 byte packets
1 10.36.0.1 (10.36.0.1) 11.761 ms 12.034 ms 12.967 ms
2 192.168.36.24 (192.168.36.24) 13.723 ms 2.447 ms 1.585 ms
Chris Fisher
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42563
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
If you're adding a route I believe it should have a gateway of 10.36.0.1 so something like:
Code:

route add -net 192.168.36.0 netmask 255.255.255.0 gw 10.36.0.1


What is the output of "route -n"?

Also you may want to check a "tracert 192.168.36.24" from one of your LAN PC's.
Nick Howitt
Platinum Boarder
Posts: 4150
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2012/06/13 14:59 By NickH.
The administrator has disabled public write access.
 
#42566
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
I get "SIOCADDRT: Network is unreachable"

I forgot to mention that I am also unable to hit IPs in the 10.36.0.0/24 (OpenVPN) range from the client box's lan either but I can from the client box's console.
Chris Fisher
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42585
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
... and the output to "route -n" and the LAN tracert?

Are you remembering that any for any addition you make to the local routing table you'll probably have to make something similar at the remote end?
Nick Howitt
Platinum Boarder
Posts: 4150
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42590
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
Here is the route -n I forgot.

This one is with the tunnel down

Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
98.x.x.0 0.0.0.0 255.255.255.224 U 0 0 0 eth0
192.168.22.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
0.0.0.0 98.x.x.x 0.0.0.0 UG 0 0 0 eth0

This one is with the tunnel up

Destination Gateway Genmask Flags Metric Ref Use Iface
10.36.0.9 0.0.0.0 255.255.255.255 UH 0 0 0 tun1
10.8.0.2 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
98.x.x.x 0.0.0.0 255.255.255.224 U 0 0 0 eth0
192.168.22.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.36.0 10.36.0.9 255.255.255.0 UG 0 0 0 tun1
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
10.36.0.0 10.36.0.9 255.255.255.0 UG 0 0 0 tun1
0.0.0.0 98.x.x.x 0.0.0.0 UG 0 0 0 eth0


Here is the tracert from a pc in the lan. It stops at the lan gateway

Tracing route to 192.168.36.24 over a maximum of 30 hops

1 <1 ms <1 ms <1 ms 98.X.X.X [192.168.22.1]
2 * * * Request timed out.
3 * * * Request timed out.
4 * * * Request timed out.
5 * * * Request timed out.
6 * * * Request timed out.
7 * * * Request timed out.
8 * * * Request timed out.
9 * * * Request timed out.
10 * * * Request timed out.
11 * * * Request timed out.
12 * * * Request timed out.
13 * * * Request timed out.
14 * * * Request timed out.
15 * * * Request timed out.
16 * * * Request timed out.

I haven't tried to add routes to the far end b/c I didn't think they would be neeeded since it doesn't need routes for standalone OpenVPN clients and ultimately the far site is going to see everything as coming from the clients boxes IP and from what I can see the problem is getting out of the client's lan first. If it was timing out after hitting the OpenVPN gateway then I would think routes on the far end need added.

That said I clearly don't know how to accomplish my goal so let's throw out what I think and go with what you think
Chris Fisher
Fresh Boarder
Posts: 15
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42597
Re: SITE to SITE with OpenVPN working..sort of 11 Months, 2 Weeks ago  
I'm puzzled. It looks like you already have a route to 192.168.36.0/24 via 10.36.0.9. I don't know the OpenVPN site-to-site set up and I can't fathom what it is not doing. Other people e.g. here have got it going successfully. You may want to post a help request into his thread.

The other thing I am wondering about is firewall rules. Do you have a default allow all out or block all out rule? Can you also give me the output of:
Code:

iptables -L -n -v
iptables -t nat -L -n -v

Please put the output between [ code ] and [ /code ] tags (removing the spaces between the [ and ]).
Nick Howitt
Platinum Boarder
Posts: 4150
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 123
  get the latest posts directly to your desktop