[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

cant access other computer via openvpn link

Hi
I always use pfsense a openvpn or hardware route as openvpn server.

this is first time i am using just debain server as openvpn server and i am bit of confused.
bellow is network diagram.


I cant connect to openvpn server which is 192.168.2.120 .
but i cant connect to other server like 192.168.2.110

bellow is my openvpn server.conf

do i need to push the route ?? i did that but stiill dont work ...

can any one please give me some light ...

I just want to connect to other servers via this openvpn connection.

port 1194
proto udp
dev tun
ca /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/ca.crt
cert /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/server.crt
key /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/server.key
dh /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/dh1024.pem
server 192.168.2.0 255.255.255.0
#server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
#push "route 192.168.2.0 255.255.255.0"
#push "redirect-gateway def1"
push "dhcp-option DNS 192.168.2.1"
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
log /var/log/openvpn.log
log-append /var/log/openvpn.log
verb 3
~

Open in new window

openvpn.GIF
0
fosiul01
Asked:
fosiul01
  • 2
1 Solution
 
yadayaCommented:
Hi.
Option server in openvpn config is subnet for clients.

Here correct config. Just add route to 192.168.247.0/24 through 192.168.2.120 on your router.
port 1194
proto udp
dev tun
ca /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/ca.crt
cert /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/server.crt
key /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/server.key
dh /usr/share/doc/openvpn/examples/easy-rsa/2.0/keys/dh1024.pem
server 192.168.247.0 255.255.255.0 # was server 192.168.2.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.2.0 255.255.255.0"
#push "redirect-gateway def1"
push "dhcp-option DNS 192.168.2.1"
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
log /var/log/openvpn.log
log-append /var/log/openvpn.log
verb 3

Open in new window

0
 
fosiul01Author Commented:
Hi
Sorry for late reply.
I have done what you said..

but problem still persit..

if i do a netstat -nr on openvpn server..

the out put is :


destination          gateway               mask                        flags
192.168.247.0     192.168.247.2      255.255.255.0       UG                  tun0
0.0.0.0                   192.168.2.1        255.255.255.0      UG                eth0


as you can see.. tun0 default gateway is 192.168.247.2  ,

i guess for this reason i cant connect to other server where the default gateway should be 192.168.2.1 ..

any idea??
0
 
yadayaCommented:
Can you post netstat -nr on openvpn client?

Is ip forwarding anables on openvpn server?
How to enable IP Forwarding in Linux
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now