Machine behind client cannot access service on vpn server

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
luciferlu
OpenVpn Newbie
Posts: 2
Joined: Sat Jan 15, 2011 12:58 pm

Machine behind client cannot access service on vpn server

Post by luciferlu » Sat Jan 15, 2011 1:47 pm

I run a OpenVPN server on freebsd, and there is one client. Both server and client have a subnet behind them.
The machine behind VPN server can access client and machine behind client. The client and machines behind client can access the machine behind the VPN server. The client itself can access the services running on VPN server and any machine behind the server, such as ssh, ftp etc, but machines behind the client cannot. Is anything wrong with my config.
BTW, Client connect to server through internet. I map 1194 port on the server side gateway to vpn server. Machines behind the client can ping server and machine behind server.

My environment list below
Server:
  • OS: FreeBSD, no iptable running, ip-forward configured
  • IP: 192.168.1.2, the gateway is a router on 192.168.1.1 with static rout rule: 192.168.2.* to 192.168.1.2, 192.168.127.* to 192.168.1.2
  • vpn running on subnet 192.168.127.*
  • server config:

Code: Select all

port 1194
proto tcp
dev tun
ca easy-rsa/keys/ca.crt
cert easy-rsa/keys/server.crt
key easy-rsa/keys/server.key
dh easy-rsa/keys/dh1024.pem
server 192.168.127.0 255.255.255.0
ifconfig-pool-persist ipp.txt
route 192.168.2.0 255.255.255.0
push "route 192.168.1.0 255.255.255.0"
push "route 192.168.2.0 255.255.255.0"
client-config-dir ccd
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
log         /var/log/openvpn.log
verb 3
  • content in client ccd file

Code: Select all

iroute 192.168.2.0 255.255.255.0
Client:
  • OS: Windows 7, ip-forward configured
  • IP: 192.168.2.2, the gateway is a router on 192.168.2.1 with static rout rule: 192.168.1.* to 192.168.2.2 and 192.168.127.* to 192.168.2.2
  • client config:

Code: Select all

client
dev tun
proto tcp
remote server_ip 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca ../keys/ca.crt
cert ../keys/CakeForYou-Server.crt
key ../keys/CakeForYou-Server.key
ns-cert-type server
comp-lzo
verb 3

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Machine behind client cannot access service on vpn serve

Post by maikcat » Mon Jan 17, 2011 12:19 pm

hi there,

did you try ro remove push "route 192.168.2.0 255.255.255.0" from the server cfg..

because you pushing the route for the 2.x subnet to your client (who belongs into 192.168.2.x subnet..)

cheers,
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

luciferlu
OpenVpn Newbie
Posts: 2
Joined: Sat Jan 15, 2011 12:58 pm

Re: Machine behind client cannot access service on vpn serve

Post by luciferlu » Tue Jan 18, 2011 12:57 pm

Maikcat,
Thanks for your replay. I just tried your suggestion, but it still does not work.
Is there anything I can do?

Thanks.

Post Reply