OpenVPN connect 2 site

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
chucki21
OpenVpn Newbie
Posts: 4
Joined: Tue Jan 31, 2017 3:12 pm

OpenVPN connect 2 site

Post by chucki21 » Tue Jan 31, 2017 3:36 pm

Hello,

I have a problem with connection between 2 linux machine. on GNS3 project
Diagram network

[ LINUX_A eth0: 192.168.1.1/24 (internal_interface) | eth1: 192.168.9.2/24 (external_interface) ] ----------> ROUTER <------------- [ LINUX_B eth1: 192.168.8.2/24 (external_interface) | eth0: 192.168.2.1/24 (internal_interface) ].

I wanna that LAN from both site see each other using connection from LINUX_A (client) into LINUX_B(server)

[LINUX_B] - server.conf contain (principale things):
ifconfig 10.8.0.0. 255.255.255.0
push "route 10.8.0.0 255.255.255.0"
push "route 192.168.1.0 255.255.255.0"
client-config-dir ccd
route 192.168.1.0 255.255.255.0
push "redirect-gateway def1 bypass-dhcp"
client-to-client
- and /etc/openvpn/ccd/client2 (contain: iroute 192.168.1.0 255.255.255.0 )

[LINUX_A] client.conf important setting [ remote 192.168.8.2 ]

LINUX_B: #openvpn --config server.conf
LINUX_A: #openvpn --config client.conf
and obtain error like:
/sbin/ip route add 192.168.1.0/24 via 10.8.0.1 RTNETLINK answers: File exists
Error:linux route add command failed: external program exited with error status: 2
/sbin/ip route add 10.8.0.0./24 via 10.8.0.5 RTNETLINK answers: File exists
Error:linux route add command failed: external program exited with error status: 2


Please help me with some tips,give me an idea or ​​something...plssss

PS. LINUX_A machine can ping machine from 192.168.2.0 but just him. Other machine from 192.168.1.0 can't do that or reverse (192.168.2.0 into 192.168.1.0)

chucki21
OpenVpn Newbie
Posts: 4
Joined: Tue Jan 31, 2017 3:12 pm

Re: OpenVPN connect 2 site

Post by chucki21 » Wed Feb 01, 2017 7:26 am

Nobody can help me ? no one ?


chucki21
OpenVpn Newbie
Posts: 4
Joined: Tue Jan 31, 2017 3:12 pm

Re: OpenVPN connect 2 site

Post by chucki21 » Wed Feb 01, 2017 1:22 pm

:) thank you...I readed many times that links but doesn't work...

chucki21
OpenVpn Newbie
Posts: 4
Joined: Tue Jan 31, 2017 3:12 pm

Re: OpenVPN connect 2 site

Post by chucki21 » Tue Feb 07, 2017 10:33 am

Thank you for nothing and thank you smart guy who send me to read tutorial without read my problem.
The solution :

[ topology subnet ]
[ push 192.168.2.0 255.255.255.0 ]
[ client-config-dir ccd ]
[ route 192.168.1.0 255.255.255.0 ]

in /etc/openvpn/ccd/server (his name must be the same with what u declare at questions when u create certificate)
[ iroute 192.168.1.0 255.255.255.0 ]

Now ...when you start openvpn client or server it gives you an ip which can be different what u have in table route so check before !!!

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: OpenVPN connect 2 site

Post by TinCanTech » Tue Feb 07, 2017 1:05 pm

chucki21 wrote::) thank you...I readed many times that links but doesn't work...
I assure you, it does work .. you just did it wrong.
chucki21 wrote:Thank you for nothing and thank you smart guy who send me to read tutorial without read my problem
I read your problem as did others but you did not post any details we could use to help.

In future .. Please see:
HOWTO: Request Help !

:geek:

Also,
  • NOTE: your local LAN uses the extremely common subnet address 192.168.0.x or 192.168.1.x. Be aware that this might create routing conflicts if you connect to the VPN server from public locations such as internet cafes that use the same subnet.
:arrow: Never use 192.168.0.0/24 or 192.168.1.0/24 (or other common subnets) for your OpenVPN LAN :!:
  • You are advised to change your LAN to a more unique RFC1918 compliant subnet. f.e 192.168.143.0/24

Post Reply