Skip to content

Instantly share code, notes, and snippets.

@facundovictor
Last active November 20, 2017 13:11
Show Gist options
  • Save facundovictor/9bc927c457acec6b1ca371d441ed3ae1 to your computer and use it in GitHub Desktop.
Save facundovictor/9bc927c457acec6b1ca371d441ed3ae1 to your computer and use it in GitHub Desktop.
openconnect scripts
#!/usr/bin/env bash
# References:
# https://github.com/dnschneid/crouton/wiki/Using-Cisco-AnyConnect-VPN-with-openconnect
# http://tuxdiary.com/2014/09/04/cisco-anyconnect-vpn-with-openvpn-openconnect/
INTERFACE=tun1
# Clear the tun interface
ifconfig $INTERFACE down
# Clear vpn
openvpn --rmtun --dev $INTERFACE
#!/usr/bin/env bash
# References:
# https://github.com/dnschneid/crouton/wiki/Using-Cisco-AnyConnect-VPN-with-openconnect
# http://tuxdiary.com/2014/09/04/cisco-anyconnect-vpn-with-openvpn-openconnect/
VPNGRP=<vpngrp>
VPNUSER=<user>
VPNURL=<vpn-router-url>
INTERFACE=tun1
# Create the tun interface, set it up, and use it for connection the the VPN
openvpn --mktun --dev $INTERFACE && \
ifconfig $INTERFACE up && \
openconnect -s /etc/vpnc/vpnc-script $VPNURL --user=$VPNUSER --authgroup=$VPNGRP --interface=$INTERFACE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment