Add Network Address to OpenVPN Host

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
User avatar
palswim
OpenVpn Newbie
Posts: 11
Joined: Fri Mar 30, 2012 8:37 pm

Add Network Address to OpenVPN Host

Post by palswim » Thu May 31, 2018 10:16 pm

I am trying to configure my OpenVPN host as a DNS. But, with my current setup, the clients don't seem to be able to access the server through OpenVPN, though they have no trouble accessing each other.

My server configuration:

Code: Select all

proto tcp
dev tap
server 192.168.254.0 255.255.255.0
client-to-client
persist-key
persist-tun
With this configuration, the clients cannot ping the OpenVPN server at either 192.168.254.1 or 192.168.254.0, and neither can they access any other sort of service on the OpenVPN server.

So, I read somewhere to add a couple of directives to push to the clients:

Code: Select all

push "dhcp-option DNS 192.168.254.1"
push "route 192.168.254.0 255.255.255.0"
But, this still doesn't give the server addressability for the clients. I can see that my clients now have 192.168.254.1 as a DNS, but I still cannot access that address. Also, I see that my clients have 192.168.254.0 for their DHCP Server address, which does not seem valid, either.

How do I configure OpenVPN as a server so that the clients can access the server through the VPN (at address 192.168.254.1 in this example)?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Add Network Address to OpenVPN Host

Post by TinCanTech » Thu May 31, 2018 10:24 pm

palswim wrote:
Thu May 31, 2018 10:16 pm
So, I read somewhere to add a couple of directives
It is the somewhere part which bothers me .. :cry:

Please Start here:
HOWTO: For OpenVPN Community Edition

Also, Please see:
HOWTO: Request Help ! {2}

User avatar
palswim
OpenVpn Newbie
Posts: 11
Joined: Fri Mar 30, 2012 8:37 pm

Re: Add Network Address to OpenVPN Host

Post by palswim » Sat Jun 02, 2018 12:02 am

TinCanTech wrote:
Thu May 31, 2018 10:24 pm
palswim wrote:
Thu May 31, 2018 10:16 pm
So, I read somewhere to add a couple of directives
It is the somewhere part which bothers me .. :cry:
If you must know, it came from a Q&A discussion on a similar topic. I understand what those directives do, but I didn't want to delve into the details in the post.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Add Network Address to OpenVPN Host

Post by TinCanTech » Sat Jun 02, 2018 12:14 am

palswim wrote:
Sat Jun 02, 2018 12:02 am
I understand what those directives do, but I didn't want to delve into the details in the post.
ok

So what did you want ?

bbuckm
OpenVPN User
Posts: 39
Joined: Thu Apr 26, 2018 2:45 pm

Re: Add Network Address to OpenVPN Host

Post by bbuckm » Sat Jun 02, 2018 12:35 am

palswim wrote:
Thu May 31, 2018 10:16 pm

Code: Select all

push "dhcp-option DNS 192.168.254.1"
That option tells the client to expect a DNS server at IP address 192.168.254.1. It doesn't actually set up a DNS server at that address. For that you would need to install dnsmasq or similar at that IP address.

User avatar
palswim
OpenVpn Newbie
Posts: 11
Joined: Fri Mar 30, 2012 8:37 pm

Re: Add Network Address to OpenVPN Host

Post by palswim » Sat Jun 02, 2018 7:26 am

bbuckm wrote:
Sat Jun 02, 2018 12:35 am
palswim wrote:
Thu May 31, 2018 10:16 pm

Code: Select all

push "dhcp-option DNS 192.168.254.1"
That option tells the client to expect a DNS server at IP address 192.168.254.1. It doesn't actually set up a DNS server at that address. For that you would need to install dnsmasq or similar at that IP address.
Right; I have DNSMasq on the VPN server. I am trying to have the server listen on 192.168.254.1.

User avatar
palswim
OpenVpn Newbie
Posts: 11
Joined: Fri Mar 30, 2012 8:37 pm

Re: Add Network Address to OpenVPN Host

Post by palswim » Tue Jun 05, 2018 6:10 am

Do I need to run a separate OpenVPN instance on the server to connect as a client and the push the directives to target the server's client VPN address? I wouldn't think so, but that could work.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Add Network Address to OpenVPN Host

Post by TinCanTech » Tue Jun 05, 2018 10:53 am

palswim wrote:
Thu May 31, 2018 10:16 pm
With this configuration, the clients cannot ping the OpenVPN server at either 192.168.254.1 or 192.168.254.0
You can not ping 192.168.254.0 because it is not a host address. As for pinging 192.168.254.1, if that does not work then it is probably your firewall.

Please see:
HOWTO: Request Help !

User avatar
palswim
OpenVpn Newbie
Posts: 11
Joined: Fri Mar 30, 2012 8:37 pm

Re: Add Network Address to OpenVPN Host

Post by palswim » Wed Jun 06, 2018 9:27 pm

TinCanTech wrote:
Tue Jun 05, 2018 10:53 am
palswim wrote:
Thu May 31, 2018 10:16 pm
With this configuration, the clients cannot ping the OpenVPN server at either 192.168.254.1 or 192.168.254.0
You can not ping 192.168.254.0 because it is not a host address. As for pinging 192.168.254.1, if that does not work then it is probably your firewall.
I believe you are saying that the OpenVPN server should listen at 192.168.254.1 automatically. I tried this with a server on another machine and the server does listen on the expected address (x.x.x.1).

While I don't think a firewall is causing this, I do think the OpenVPN software or version on DD-WRT dropped this feature or has a bug.

So, to answer my initial question: To add a network address to an OpenVPN server, just configure the server as normal; by default it will have the .1 address.

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Add Network Address to OpenVPN Host

Post by TinCanTech » Thu Jun 07, 2018 1:23 am

palswim wrote:
Wed Jun 06, 2018 9:27 pm
I believe you are saying that the OpenVPN server should listen at 192.168.254.1 automatically
It listens where you tell it to.

Post Reply