Page 1 of 1

OpenVPN connect 2 site

Posted: Tue Jan 31, 2017 3:36 pm
by chucki21
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)

Re: OpenVPN connect 2 site

Posted: Wed Feb 01, 2017 7:26 am
by chucki21
Nobody can help me ? no one ?

Re: OpenVPN connect 2 site

Posted: Wed Feb 01, 2017 11:20 am
by TinCanTech

Re: OpenVPN connect 2 site

Posted: Wed Feb 01, 2017 1:22 pm
by chucki21
:) thank you...I readed many times that links but doesn't work...

Re: OpenVPN connect 2 site

Posted: Tue Feb 07, 2017 10:33 am
by chucki21
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 !!!

Re: OpenVPN connect 2 site

Posted: Tue Feb 07, 2017 1:05 pm
by TinCanTech
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