-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Openfortivpn on Ubuntu 20.04 #673
Comments
First of all, it's probably a bad idea to have both
or ask pppd:
Then are you building openfortivpn from sources or installing the DEB package? I suspect that the DEB package is outdated on Ubuntu:
|
But then this error is not tied to a specific version of openfortivpn:
It works for me just fine on Ubuntu 20.04. However I have installed
Let me check without |
|
Thank you for your quick answer. $ openfortivpn --version
1.13.3
$ When I run: sudo openfortivpn x.x.x.x:999 -u USER -p PASSWORD --set-routes=1 --set-dns=1 --pppd-use-peerdns=0 --trusted-cert XXXXXXXXXXXXXXXXXXX I got this in the console:
Same as you apparently. $ ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 37 avril 27 08:44 /etc/resolv.conf -> /run/systemd/resolve/stub-resolv.conf
$
$ ls -l /run/systemd/resolve/stub-resolv.conf
-rw-r--r-- 1 systemd-resolve systemd-resolve 720 avril 27 13:28 /run/systemd/resolve/stub-resolv.conf
$ output of: dpkg -l | grep resolv $ dpkg -l | grep resolv
ii libmaven-resolver-java 1.4.1-1 all Library to handle Java artifact repositories
$ |
If I use 1.12.0 from apt install I've got completely different message
|
OK. So you don't have I can reproduce the problem with the snap, and it makes sense as the snap's confinement prevents from modifying files in
I can investigate whether and how the snap confinement problem can be fixed. But please open an issue against the snap, as this is not really an openfortivpn problem: Also what's strange is that installing To obtain the exact version of openfortivpn, please run:
Finally and most importantly I cannot explain this:
This doesn't look like it's specific to the snap. It's as if your VPN appliance weren't sending new DNS servers or search domains anyway. To double-check that, I would need the (sanitized) output of
|
The problem with the DEB package is different and it's not a known issue I'm afraid. It looks like your VPN appliance is using ciphers that are not supported by your OpenSSL by default. Have you tweaked your OpenSSL configuration (
Also run
|
I have not tweaked anything at all. I just installed a fresh new Ubuntu 20.04 on my laptop. Same as you |
I asked a colleague who is still under Ubuntu 18.04 and Openfortivpn 1.6.x |
It looks like there's no XML because the FortiGate appliance doesn't send any:
The FortiGate appliance returns a 404 error. Are you positive nothing has been changed in the configuration of the FortiGate appliance? |
The core problem is here: Lines 860 to 880 in e59bc21
As you can see openfortivpn first sends a /remote/fortisslvpn_xml request for an XML-formatted configuration, which in your case fails with a 404 error. I understand recent Fortigate appliances are able to respond with success (200) to this request. Anyway.Then openfortivpn sends a /remote/fortisslvpn request for an HTML-formatted configuration, which succeeds with a 200 status code. The HTML response is parsed by parse_config() which clearly has never expected to find DNS servers and search domains in the HTML configuration, only <dest>/<mask> split VPN routes:Lines 810 to 857 in e59bc21
Therefore this is OK:
For this reason it is actually not required to modify
Regardless you shouldn't see the Permission issue on /etc/resolv.conf warning. However that's a snap issue and I'll follow up on the issue you've opened here: |
The only remaining problem here is the one with the openfortivpn 1.12.0 DEB package:
I really have no clue. @mrbaseman? |
@mrbaseman Could it be that this is an old FortiGate appliance with obsolete ciphers that have been disabled by default in recent Linux distributions such as Ubuntu 20.04? Is it possible to re-enable these ciphers programatically from openfortivpn? See for example: |
Well, you can choose ciphers with the --cipher-list option to override the default settings of the openssl which openfortivpn has been linked against. --min-tls and --insecure-ssl as you suggested are possible tweaks. |
Indeed the openfortivpn snap is built against
So in effect it is as if the snap was running on an Ubuntu 18.04 machine although the host really is an Ubuntu 20.04 machine. On the other hand the openfortivpn DEB package really runs on Ubuntu 20.04. I'm afraid we will see this problem more often as more users migrate to Ubuntu 20.04 but still need to access older FortiGate appliances. Is there a way to detect older FortiGate appliances and programmatically downgrade the ciphers from openfortivpn, as most users won't know how to do that easily? Perhaps those FortiGate appliances that do not provide an XML config and respond with a 404 status code to |
Maybe this is an unlucky combination of the oldest FortiOS that we have seen and the latest Ubuntu on the client side. |
Then perhaps it's worth printing a warning if the config is not available in XML format? |
yes, as long as |
I had a look at the VPN appliance and it's a FortiGate 100D as far as I can see:
@ethali Do you know by any chance the version of FortiOS? I don't have access to the Fortinet support site but have found on the internet that EOS of Fortigate 100D is 2022-09-13 and that it supports at least FortiOS 5.6: In your case I see two possibilities:
|
Hi @DimitriPapadopoulos and @mrbaseman . Thank you for taking time to watch this issue. As you say @DimitriPapadopoulos there will be problems for all people switching to 20.04 and connecting to old FortiOS.
I asked the administrator what is the version of our FortiOS. here's the answer : v4.0,build0689,14215 (MR3 Patch 18)
Can you help me on this?
Maybe I could try this. Fortunately and at least I can connect by VPN with the Snap version even if I have to set DNS servers manually... |
I believe all the D series models support up to FortiOS 6.0.x. I've started with 5.0 but I think the xml config was already there at that time, but maybe it was 5.2... |
It's completely outdated, unmaintained and dangerously vulnerable as far as I can tell 😃 I have deleted one of your comments, the long one that gives away too much about your FortiGate appliance - I was afraid it could lead to an easy and successful attack against your organisation... |
Yes thank you you did right. |
I have added PR #676 to emit a warning when the FortiGate appliance is unable to provide an XML configuration. |
Depending on the Linux distribution, you may even need to build and install your own version of OpenSSL. Not sure about Ubuntu 20.04, but I have found this discussion about TLS 1.0/1.1 support on a Debian mailing list: Perhaps we could call You may have to change a few things here, I really don't know: Lines 972 to 1005 in 1baae9e
|
OK so the administrator gave an access to another FortiOS which is version 6.x. Now it works great under Ubuntu 20.04. So this issue remains true to those who depend on an old FortiOS... Thank you all for your reactivity and kindness. @DimitriPapadopoulos I let you close this issue (or not) if you think that is relevent (or not) ;-) |
even accepting a patch I would be careful if the aim is to work together with outdated openssl versions |
@mrbaseman Yes,you're right about it. See also #677. @ethali Those who depend on an old FortiOS are doomed anyway - it shouldn't be long before their system is taken over 😄 |
@ethali Forgot to ask, don't any of these options help? |
@DimitriPapadopoulos It works great with Thank you. |
Hi everyone.
Since migration to Ubuntu 20.04 from Ubuntu 19.04 I can connect but DNS config isn't done.
Here's what I run:
sudo openfortivpn x.x.x.x:10443 -u USER -p PASSWORD --set-routes=1 --set-dns=1 --pppd-use-peerdns=1 --trusted-cert XXXXXXXXXXXXXXXXXXX
This issue is that resolv.conf has permission issue even when ran with sudo => Could not open /etc/resolv.conf (Permission denied).
And here's what's in the console
WARN: You should not pass the password on the command line. Type it interactively or use a config file instead.
INFO: Connected to gateway.
INFO: Authenticated.
INFO: Remote gateway has allocated a VPN.
INFO: Got addresses: [x.x.x.x], ns [172.17.100.2, 172.17.100.1]
INFO: Negotiation complete.
INFO: Negotiation complete.
INFO: Interface ppp0 is UP.
INFO: Setting new routes...
WARN: Route to gateway exists already.
WARN: Route to gateway exists already.
INFO: Adding VPN nameservers...
WARN: Could not open /etc/resolv.conf (Permission denied).
INFO: Tunnel is up and running.
Could someone help me?
Thank you.
The text was updated successfully, but these errors were encountered: