LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-26-2008, 03:40 PM   #1
n8tgc
Member
 
Registered: Jul 2004
Location: Metro Detroit
Distribution: SUSE 10, 11.1 & DSL
Posts: 35

Rep: Reputation: 15
OpenVPN Bi-Directional (server-to-server)... HOW?


HELP! I am attempting to setup a OpenVPN connection that will allow traffic to go from any workstation on Network A to any workstation on Network B (and vice-versa)

Network A is as follows.
OpenVPN server IP subnet = 192.168.143.0
OpenVPN server IP address = 192.168.143.12
VPN Network subnet = 10.14.30.0
VPN Network address = 10.14.30.1

Network B is as follows.
OpenVPN client IP subnet = 192.168.163.0
OpenVPN cclient IP address = 192.168.163.8
VPN Network subnet = 10.14.30.0
VPN Network address = 10.14.30.6

Using the following configuration files, I can establish a connection from the client to the server. Also, the client is able to ping any workstation on the server network. For example 192.168.16.8 can ping any 192.168.143.0 address. That direction works well. However, the server cannot ping the client (192.168.143.12 (VPN server) cannot ping 192.168.163.8). But 192.168.143.12 CAN ping 10.14.30.6 so I know that the traffic from the VPN server is getting to the client machine, just not to the right device. Also, other than the VPN client on network B (192.168.163.8) no other workstation on Network B can ping anything on network A, despite having the router on Network B routing 192.168.143.0 traffic to 192.168.163.8.

Any ideas? Can OpenVPN be a conduit that will allow traffic from any workstation on Network A to communicate with and workstation on Network B?

Here are the config files.

* server.conf
port 1194
proto udp
dev tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key
dh /etc/openvpn/dh1024.pem
server 10.14.30.0 255.255.255.0
push "route 192.168.143.0 255.255.255.0"
keepalive 10 120
comp-lzo
persist-key
persist-tun
max-clients 3
status openvpn-status.log
verb 5
mute 20
client-config-dir ccd
route 192.168.163.0 255.255.255.0
client-to-client
push "route 192.168.163.0 255.255.255.0"

* client3 (located in /etc/openvpn/ccd/)
iroute 192.168.163.0 255.255.255.0

* client.conf
client
dev tun
proto udp
remote xxx.xxx.xxx.xxx 1194
nobind
persist-key
persist-tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client3.crt
key /etc/openvpn/client3.key
comp-lzo
verb 3
mute 20
 
Old 12-28-2008, 12:17 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Most likely a routing problem.

Can you post the output of "route" on both machines?
 
Old 12-28-2008, 09:20 AM   #3
n8tgc
Member
 
Registered: Jul 2004
Location: Metro Detroit
Distribution: SUSE 10, 11.1 & DSL
Posts: 35

Original Poster
Rep: Reputation: 15
Here's the routes...

Server:~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.14.30.2 * 255.255.255.255 UH 0 0 0 tun0
10.66.1.0 10.14.30.2 255.255.255.0 UG 0 0 0 tun0
10.14.30.0 10.14.30.2 255.255.255.0 UG 0 0 0 tun0
192.168.143.0 * 255.255.255.0 U 0 0 0 eth1
link-local * 255.255.0.0 U 0 0 0 eth1
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.143.1 0.0.0.0 UG 0 0 0 eth1

Client:~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.14.30.5 * 255.255.255.255 UH 0 0 0 tun0
192.168.163.0 * 255.255.255.0 U 0 0 0 eth0
10.14.30.0 10.14.30.5 255.255.255.0 UG 0 0 0 tun0
192.168.143.0 10.14.30.5 255.255.255.0 UG 0 0 0 tun0
link-local * 255.255.0.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default 192.168.163.1 0.0.0.0 UG 0 0 0 eth0
 
Old 12-28-2008, 03:29 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Hopefully I've read everything correctly, but as I see things, you need to add a route on the server to see the client network (192.168.163.0/255.255.255.0 to use tun0). Not quite sure why
Code:
route 192.168.163.0 255.255.255.0
isn't working, but I don't use this setup.

Try your openvpn logs to see if there's an error on trying to set this route on startup.
 
Old 12-28-2008, 03:31 PM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Actually, it's probably a ccd problem - what is in /etc/openvpn/ccd? Did you create a client file?
 
Old 12-28-2008, 04:11 PM   #6
n8tgc
Member
 
Registered: Jul 2004
Location: Metro Detroit
Distribution: SUSE 10, 11.1 & DSL
Posts: 35

Original Poster
Rep: Reputation: 15
CCD file is as follows

* client3 (located in /etc/openvpn/ccd/)
iroute 192.168.163.0 255.255.255.0

I'll look in the log file regarding the route suggestion.

Thank you for your assistance thus far. Today being Sunday I am away from the hardware but will jump back into he deep end tomorrow morning.

Last edited by n8tgc; 12-30-2008 at 04:18 PM.
 
Old 01-19-2009, 09:23 PM   #7
adamchal
LQ Newbie
 
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
Did you ever figure this out?

I'm trying to do the same thing, create a site-to-site VPN with two linux machines using OpenVPN. Why wouldn't you use a tap0 device on the client (or Network B) machine too?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
OpenVPN client has not default gateway when connect to OpenVPN server sailershen Linux - Security 3 03-04-2010 03:20 AM
OpenVPN sometimes does not forward all traffic to server depam Linux - Software 1 06-28-2008 05:13 PM
IPCOP - Proxy server over OpenVPN waelaltaqi Linux - Networking 0 11-30-2006 11:50 AM
Routing from OpenVPN server jjge Linux - Networking 1 08-29-2006 10:34 AM
[openvpn] routing at server side Zym0tiC Linux - Networking 2 10-06-2005 04:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:14 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