LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-10-2006, 04:08 AM   #1
mrpc_cambodia
Member
 
Registered: Jun 2004
Posts: 131

Rep: Reputation: 15
OpenVPN Client can't ping host by name


hi,

I'm using openVPN addon for IPCop as my VPN Solution. from my xp pro pc, I can connect to the OpenVPN server. and I can ping any computer on the VPN server Lan by IP but not by computer name.


What other configuration should I make to be able to ping lan pc by computer name?


THanks,
 
Old 04-10-2006, 04:11 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well you'll need dns and all that to ping by hostname. sounds like you aren't being given DNS details from the DHCP
 
Old 04-10-2006, 12:32 PM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
you could also edit the hosts file on the client machine .. but that is a maintainnace headache..
That is why DNS was invented after all, so you didn't have to edit hosts files on evry machine
 
Old 04-17-2006, 03:01 AM   #4
mrpc_cambodia
Member
 
Registered: Jun 2004
Posts: 131

Original Poster
Rep: Reputation: 15
so how to configure on the OpenVPN to provide dns info to the connecting client?

thanks,

mrpc_cambodia
 
Old 04-18-2006, 09:30 PM   #5
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
How to push DHCP options (DNS) to openVPN Clients
http://openvpn.net/howto.html#dhcp

DNS How-to
Simple
http://www.linuxhomenetworking.com/l...dns-static.htm
More detailed info
http://langfeldt.net/DNS-HOWTO/BIND-9/DNS-HOWTO-5.html
 
Old 07-09-2019, 06:39 PM   #6
begleysm
LQ Newbie
 
Registered: Jul 2019
Posts: 4

Rep: Reputation: Disabled
Lightbulb

Your `/etc/resolv.conf` file defines where your computer should look to resolve hostnames into IP addresses. The basic problem is that `/etc/resolv.conf` doesn't get updated when you run `openvpn` by default.

Here's what you need to do to fix the problem.

1.) Append the following onto your `server.conf` file on your OpenVPN server machine (typically located at `/etc/openvpn/server.conf`) to have the server to the client where to look to convert hostnames to IP addresses.

push "dhcp-option DNS 192.168.1.1"
push "dhcp-option DOMAIN mylocaldomain.lan"



2.) Install `resolvconf` on your client machine and link the standard `resolv.conf` to `resolvconf`'s version with the following commands to have a function capable of modifying `resolv.conf`

sudo apt install resolvconf
sudo mv /etc/resolv.conf /etc/resolv.conf.orig
sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf


3.) Append the following to the bottom of your `client.ovpn` file to run `resolvconf` whenver the OpenVPN server is connected to or disconnected from.

up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf


4.) Whenever you run `openvpn` you'll have to do so with the `-script-security 2` flag to allow `openvpn` to run `resolvconf`. Here is an example call

sudo openvpn --script-security 2 --config /path/to/client.ovpn


You can read a more detailed version of the above instructions with some example code of my (working) OpenVPN server here: https://steamforge.net/wiki/index.ph..._%26_hostnames

Last edited by begleysm; 07-11-2019 at 03:14 PM.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenVPN client has not default gateway when connect to OpenVPN server sailershen Linux - Security 3 03-04-2010 02:20 AM
OpenVPN setup - can ping only one way across VPN tunnel rob_xx17 Linux - Networking 3 04-14-2006 06:36 AM
Openvpn client to client routing question soup Linux - Networking 0 02-16-2006 11:13 AM
MDK 10 host unable to ping W98SE client Manasseh Linux - Networking 2 05-16-2004 12:22 AM
A network client can't ping a foreign host via a ppp connection Leandro Linux - Networking 1 11-15-2002 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:03 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