OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Archive »
  • 18.7 Legacy Series »
  • os-openconnect as Cisco AnyConnect
« previous next »
  • Print
Pages: [1] 2

Author Topic: os-openconnect as Cisco AnyConnect  (Read 6878 times)

mrpsycho

  • Newbie
  • *
  • Posts: 33
  • Karma: 1
    • View Profile
os-openconnect as Cisco AnyConnect
« on: October 05, 2018, 01:27:06 pm »
Hello,

i'm migrating to  OPNsense from pfsense... and found great module - os-openconnect.
on pf i was using plain openconnect from pkgs.

and it was not very comfortable to use, cause i had to manage NAT rules manually (i wrote a simple script, but it needs to be updated sometimes)
so.

problem is - there is no way to add authgroup, certificate and key in web GUI on opnsense.
So, my workaround - is to edit
Code: [Select]
/usr/local/etc/rc.d/opnsense-openconnect  and add needed keys to the start function:

Code: [Select]
openconnect_start()
{
        echo "starting openconnect"
          echo ${openconnect_flags}
/usr/local/sbin/openconnect --authgroup SSLVPNClient -c /path/to/crt.cer -k /path/to/crt.key ${openconnect_flags} < /usr/local/etc/openconnect.secret 2>&1 > /dev/null
        sleep 5
ifconfig tun30000 name ocvpn0
ifconfig ocvpn0 group ocvpn
return 0
}

and it works fine.
Where can i create Feature Request for it?


And there is a bug - some servers asks for username with case sensitive requrements. Web GUI doesn't allow it. So i had to remove it in config and put it on rc.d script too
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6348
  • Karma: 437
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #1 on: October 05, 2018, 04:31:23 pm »
Can you open an issue in github / plugins?
I'll have a look next week.
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

mrpsycho

  • Newbie
  • *
  • Posts: 33
  • Karma: 1
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #2 on: October 08, 2018, 01:00:06 pm »
did it.
thanks for suggestion!
Logged

drivera

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #3 on: October 28, 2018, 05:07:46 am »
Hi!

I see the changes are already done and merged into Master, but I'm new to OPNSense and I'm not sure how I can (easily) install that code (which, from what I've seen, should be relatively bugless and safe to use) on my production instance.

Can you point me in the right direction for deploying (building?) development-grade plugins into a production instance?

Thanks!
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6348
  • Karma: 437
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #4 on: October 28, 2018, 05:27:00 am »
Via CLI:

pkg install os-openconnect-devel


(or wait for 18.7.7)
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

drivera

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #5 on: October 28, 2018, 05:35:07 am »
Any ETA on 18.7.7?
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6348
  • Karma: 437
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #6 on: October 28, 2018, 05:40:36 am »
1 or 2 weeks .. but I would be very happy if you can test the features before release :)
I you want to roll back, just to a pkg remove os-openconnect-devel and install the stable via pkg install os-openconnect.

Cant break anything ..
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

drivera

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #7 on: October 28, 2018, 06:09:13 am »
I've been testing it, and here's what I've found:

* The tunnel comes up fine, and the vpnc scripts do their job of adding the routes
* I can traverse the tunnel fine from within the firewall itself, but wasn't able to get it to forward traffic (my company's VPN adds multiple networks on the far side, which may be a factor)
* There's some hijinks with regards to the DNS config in /etc/resolv.conf - the file gets clobbered (presumably by the vpnc-scripts), and isn't restored when the VPN is taken down (the clobbering alone is a problem, tho)

I might look through the docs and help you develop a nice OPNsensitized (ha!) vpnc-scripts package that will help resolve some of these issues.

Also, the ability to add multiple tunnels would be nice in a future iteration (I'm afraid I'm not well-versed in OPN dev yet to contribute towards that at this point :D)

Cheers!
Logged

drivera

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #8 on: October 28, 2018, 06:18:08 am »
Perhaps you can help me find the docs for the following, correct OPNsensitive (ha! again :D) ways to do the following:

* add a route to a remote network via a given interface/gateway IP
* assign a DNS to an interface
* add a DNS to the base system's DNS configuration (optional: with a "numeral" priority?)

Doing these things via the O/S is "easy" - but I'd like to do them so the rest of OPNSense is also aware of what's going on.

Another question: does OPNSense support the use of a DNS server that can "split" DNS lookups by domain a-la MacOS?  I.e.  "mydomain.com is resolved via DNS A, B and C,  whereas alt-domain.com is through D and E, all others via F, G, H..."?  I know in bind one can add forwarding zones, and I think one can also do that in dnsmasq - perhaps this would be the clean way?  We'd probably have to add a comma-separated field for the user to indicate what domains "live" on the other side of the VPN.  This might also be useful for other VPN services, btw...

Cheers!
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6348
  • Karma: 437
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #9 on: October 28, 2018, 06:56:28 am »
If you can look at vpnc scripts and how to write them, this would be fine.
Alls DNS etc. things are managed via it but I don't have the time to dive into it.

When you get multiple routes pushed it's not a problem.

If you want your internal systems reach the networks you have to assign this interface and add lock prevent.
No need to configure an IP. Then you can add an outbound nat entry where your LAN is natted to the interface address of your openconnect interface.
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

drivera

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #10 on: October 28, 2018, 07:34:02 am »
What about the "split DNS"? I'll look into whether dnsmasq supports this or if BIND is required. I agree with what you said above, though.

Is there a set of OPNSense-integrated CLI commands that should be used in lieu of the lower-level O/S equivalents? I.e. "Add a route", "add a DNS", etc.?  If they were documented somewhere that'd go a long way...

Cheers!
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6348
  • Karma: 437
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #11 on: October 28, 2018, 09:06:21 am »
Normally all should be don with vpnc scripts since they work with linux and bsd
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

drivera

  • Jr. Member
  • **
  • Posts: 81
  • Karma: 0
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #12 on: October 28, 2018, 09:21:38 am »
So making the changes at the O/S level is good enough? OPNSense will pick it up and make sense of it automagically?
Logged

mrpsycho

  • Newbie
  • *
  • Posts: 33
  • Karma: 1
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #13 on: December 18, 2018, 02:40:53 pm »
Quote from: drivera on October 28, 2018, 05:35:07 am
Any ETA on 18.7.7?

i can say that dev version works fine in 18.7.9.

and main version still doesn't support groups.


DNS problem i semi-solved only with overriding option on "Unbound DNS"
Logged

mimugmail

  • Hero Member
  • *****
  • Posts: 6348
  • Karma: 437
    • View Profile
Re: os-openconnect as Cisco AnyConnect
« Reply #14 on: December 18, 2018, 02:59:20 pm »
Which option in Unbound exactly?
Logged
Twitter: mimu_muc
WWW: www.routerperformance.net
Support plans: https://www.max-it.de/en/it-services/opnsense/
Commercial Plugins (German): https://opnsense.max-it.de/

  • Print
Pages: [1] 2
« previous next »
  • OPNsense Forum »
  • Archive »
  • 18.7 Legacy Series »
  • os-openconnect as Cisco AnyConnect
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2