LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-05-2008, 08:21 AM   #1
klaasde
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
OpenVPN conencts but can't ping servers on the other network.


Hi all,

I am trying to setup VPN at my work.

I have the following situation:
At work: network is in the 10.0.0.0 range
The server running OpenVPN is CentOS 5
This is the conf file:

Code:
dev tun
ifconfig 10.1.0.1 10.1.0.2
up ./office.up
;route 192.168.0.0 255.255.0.0 10.1.0.2
tls-server
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key  # This file should be kept secret 
dh /etc/openvpn/easy-rsa/keys/dh1024.pem
verb 3
And office.up:
Code:
#!/bin/sh
route add -net 192.168.1.0 netmask 255.255.255.0 gw $5

This is what I have at home:
Network is in the 192.168.1.0 range.
Pc is use is Windows XP.
this is the conf file:

Code:
dev tun
remote ****external ip of the server
ifconfig 10.1.0.2 10.1.0.1
;up home.bat
route 10.0.0.0 255.255.255.0 10.1.0.1
tls-client
ca "E:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "E:\\Program Files\\OpenVPN\\config\\client1.crt"
key "E:\\Program Files\\OpenVPN\\config\\client1.key"
verb 3
When I try to connect from home the connection is succesful. And I can ping 10.0.0.20, this is the local-ip adress of the VPN server.
But I can't ping other serves on my office-network.
I did set ip-forwarding on by changing /etc/sysctl.conf; I did set net.ipv4.ip_forward = 1.
I also did set net.ipv4.conf.all.proxy_arp =1 .

I don't use a firewall on both environments.
I use the example files from OpenVPN tls-client.conf and tls-server.conf, and I changed those a little bit.
Here is a screenprint from ipconfig(XP) after connecting to the vpn server: http://img397.imageshack.us/my.php?i...elding1kr0.png


What did I forget??
What have I done wrong??

Last edited by klaasde; 08-05-2008 at 08:54 AM.
 
Old 08-05-2008, 09:05 AM   #2
pronoy
Member
 
Registered: Mar 2005
Location: india
Distribution: FC4, Debian Etch
Posts: 67

Rep: Reputation: Disabled
My assumption:

It means vpn server know how to reach your home network.
But whether all other machines in your office networks knows where to send the response ?
I mean, any response for 10.1.0.1 should be forwaded to your vpn server.
Check if you have a similar route in your office router.

Also I suspect office.up script (what is $5 ?), check manually (using ifconfig) the routes.
 
Old 08-05-2008, 09:35 AM   #3
klaasde
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks pronoy!!

I added a static route for 10.1.0.2 And now I can ping the other servers from my home network :-D.

Can you maybe also tell me how to setup that a ping to the server name works?

like ping DEMOSERVER01
And then that demoserver01 is known as 10.0.0.10.

Thanks in advance.
 
Old 08-05-2008, 11:55 PM   #4
pronoy
Member
 
Registered: Mar 2005
Location: india
Distribution: FC4, Debian Etch
Posts: 67

Rep: Reputation: Disabled
If you have many servers, probably having a DNS will help, but that is more complex.

Alternative:
a. If you ping a server from a linux machine, add entries in /etc/hosts file of linux machine.
/etc/hosts contains mapping between ipaddress and name
b. If you ping from a windows machine, probably you have to add an entry in c:\windows\system32\drivers\etc\lmhosts file. (I don't know windows, cross verify with others)
 
Old 08-06-2008, 02:13 AM   #5
klaasde
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Original Poster
Rep: Reputation: 0
Hi Pronoy,

I think changing the hosts file will work yes.

The config I have now works great for 1 user. What should I change to make it work for multiple users?

Thanks, Klaas
 
Old 08-06-2008, 04:32 AM   #6
pronoy
Member
 
Registered: Mar 2005
Location: india
Distribution: FC4, Debian Etch
Posts: 67

Rep: Reputation: Disabled
Unfortunately that is much complex.
You need to have a DNS server configured.
So all machine will query that DNS server to resolve the name to ip address mapping.
So for every machine you will put the DNS server ip address in /etc/resolv.conf
Another advantage for this, if later point of time, the address changes for any server, the client machines will get the name resolution to the new ip address automatically.

I don't know any other alternative
 
  


Reply



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
OpenVPN Client can't ping host by name mrpc_cambodia Linux - General 5 07-09-2019 06:39 PM
OpenVPN Bridge... Clients cant ping server or network ligerous Linux - Networking 1 05-24-2008 06:59 PM
OpenVPN - Can't ping private network chabam Linux - Networking 2 11-27-2007 07:35 AM
OpenVPN-client connects,cant see servers subnet andbn Linux - Networking 0 10-29-2007 12:24 PM
OpenVPN setup - can ping only one way across VPN tunnel rob_xx17 Linux - Networking 3 04-14-2006 06:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:38 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration