OpenMediaVault-Plugin-Developers / openmediavault-openvpn

OpenMediaVault plugin for OpenVPN
19 stars 19 forks source link

VPN Address doesn't change push directive #4

Closed subzero79 closed 10 years ago

subzero79 commented 10 years ago

When we change the default VPN address (172.17.0.0) to something different like 192.168.1.0 or 172.19.0.0, the server.conf still maintains a [push "route 172.17.0.0 255.255.0.0"] directive.

Also the DNS search domain input box, doesn't allow strings, only numbers and dots.

mb243 commented 10 years ago

I came to report the DNS issue, when I saw your comment.

I'm still seeing the same issue.

PDS-GH commented 10 years ago

I don't see anything wrong with the push route directive since it is derived from ifconfig interrogation.

To go details, IP address and subnet mask are taken from ifconfig, respectively: ifconfig | grep 'inet addr:' | grep -v inet6 | grep -vE '127.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | cut -d: -f2 | awk '{ print $1}' | head -1 ifconfig | grep 'inet addr:' | grep -v inet6 | grep -vE '127.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}' | cut -d: - f4 | awk '{ print $1}' | head -1 The subnet is then calculated according to IP address and mask.

The only limitation I see here is that the IP taken is the first one. Which should always work with the following interfaces in that order: eth0 lo tun0 If you have a second interface (eth1) and it is this one connected to your private network, the static route pushed will not be correct, but so will be the iptables rules (and probably other things).

subzero79 commented 10 years ago

You're right I realised that yesterday testing for support for someone in the forum that is was working. I've tested this 3 weeks ago, maybe I test it wrongly. I was pretty sure back then. I'll test it with an older version, there's been a few commits (not related, but anyway)

Well the domain search still only allows ip's not strings

PDS-GH commented 10 years ago

Regarding dns, you can try to edit /var/www/openmediavault/js/omv/module/admin/service/openvpn/Settings.js and change DNS search domains vtype to domainnameIP (instead of IPv4). Then restart openmediavault-engined service with 'service openmediavault-engined restart'.

mb243 commented 10 years ago

This fix doesn't work.

Date: Sun, 2 Nov 2014 13:17:05 -0800 From: notifications@github.com To: openmediavault-openvpn@noreply.github.com CC: mbeach1@outlook.com Subject: Re: [openmediavault-openvpn] VPN Address doesn't change push directive (#4)

Regarding dns, you can try to edit /var/www/openmediavault/js/omv/module/admin/service/openvpn/Settings.js and change DNS search domains vtype to domainnameIP (instead of IPv4). Then restart openmediavault-engined service with 'service openmediavault-engined restart'.

— Reply to this email directly or view it on GitHub. =

PDS-GH commented 10 years ago

Well, you have to be more specific than 'the fix doesn't work'. What does not work exactly? Did you refresh the webgui?

I just tested it and it does work. I can enter a domain name in the 'DNS search domains' field, and when saved, the push directive is correctly added to the /etc/openvpn/server.conf file, for example: push "dhcp-option DOMAIN test.com"

mb243 commented 10 years ago

Let me try to be more specific:

My initial report echoed the other user that you cannot add more than one parameter using a comma to separate them (as the help text indicates).

I can confirm that with this change, you can correctly input a domain name, but you still cannot use a comma to add multiple entries.

Sent from my iPhone, so please excuse any typos.

On Nov 3, 2014, at 2:07 PM, pollux notifications@github.com wrote:

Well, you have to be more specific than 'the fix doesn't work'. What does not work exactly? Did you refresh the webgui?

I just tested it and it does work. I can enter a domain name in the 'DNS search domains' field, and when saved, the push directive is correctly added to the /etc/openvpn/server.conf file, for example: push "dhcp-option DOMAIN test.com"

— Reply to this email directly or view it on GitHub.

PDS-GH commented 10 years ago

Indeed, you can only add one entry. It is probably because the comma is not part of the type that is checked. As a workaround in the meantime, you can completely remove the vtype line (or comment it by adding // in front of the line) so that no syntax check will be performed.

PDS-GH commented 10 years ago

I just did a pull request which, among other things, fixes the 2 issues mentioned above:

We need to wait for pull request to be reviewed and accepted, then wait for the plugin to be released.

mb243 commented 10 years ago

Thanks!

Sent from my iPhone, so please excuse any typos.

On Nov 4, 2014, at 5:06 PM, pollux notifications@github.com wrote:

I just did a pull request which, among other things, fixes the 2 issues mentioned above:

cannot input domain in 'DNS search domain' field cannot input multiple entries separated with commas We need to wait for pull request to be reviewed and accepted, then wait for the plugin to be released. — Reply to this email directly or view it on GitHub.

ghost commented 10 years ago

I assume this to be fixed now!