LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

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

Rep: Reputation: 0
Open Vpn Routing


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

openvpn --- 10.8.0.1(server remote) ... 10.8.0.6 (client)
server ---- 192.168.178.204(remote) .... 192.168.20.84 (client)

any suggestion
 
Old 01-19-2013, 11:29 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 1,344

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
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:
Code:
push "route 192.168.178.0 255.255.255.0"
For the server to get to the client network:
Code:
route 10.8.0.0 255.255.0.0
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
hesisaboury
Member
 
Registered: Dec 2010
Location: iran
Posts: 165

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
 
  


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
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 02:15 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration