Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 01-19-2013, 06:44 AM   #1
Registered: Dec 2010
Location: iran
Posts: 175

Rep: Reputation: 0
Open Vpn Routing

i have openvpn between to site now i want server behind those servers can access to each other ... i need route but ....

openvpn --- remote) ... (client)
server ---- .... (client)

any suggestion
Old 01-19-2013, 11:29 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,220

Rep: Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560Reputation: 560
In the /etc/openvpn/server.conf file on the server you can set routes for both ends that will be added when the tunnel is created. For example to add a route on the client for the server's network:
push "route"
For the server to get to the client network:
For any other systems on either network to connect to each other, you need to enable forwarding in the client and server,and to have routes set up at each end that point to the machines with the tunnel endpoints. If the openvpn server is already the default gateway (the usual case), then nothing else is needed.
Old 01-19-2013, 11:33 PM   #3
Registered: Dec 2010
Location: iran
Posts: 175

Original Poster
Rep: Reputation: 0
Thank u smallpond,
i solved it . by using NAT

echo 1 > /proc/sys/net/ipv4/ip_forward

/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT

routing did not helped


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
routing for vpn Gil@LQ Linux - Networking 4 09-04-2012 03:52 PM
Routing over VPN? Spuddy Linux - Networking 3 05-17-2011 03:41 PM
VPN routing Ipolit Linux - Networking 4 02-08-2007 01:58 AM
VPN routing Ipolit Linux - Networking 1 12-13-2006 10:54 AM
routing and VPN cboyd Linux - Networking 7 12-01-2004 02:02 AM

All times are GMT -5. The time now is 07:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration