Created
August 31, 2016 19:11
-
-
Save KrashLeviathan/2a68b271681b36d0dc894b6c1a4db48f to your computer and use it in GitHub Desktop.
Bash script to VPN into Iowa State University's network through the terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Openconnect command-line script for connecting to ISU's VPN servers | |
# from Debian-Ubuntu-derived Linux distro's. More info at | |
# http://www.socsci.uci.edu/~jstern/uci_vpn_ubuntu/ubuntu-openconnect-uci-instructions.html | |
# (because I originally got it from UCI) | |
# | |
# This script adapted from David Schneider's great page on github at | |
# https://github.com/dnschneid/crouton/wiki/Using-Cisco-AnyConnect-VPN-with-openconnect | |
# and with help from OIT's Linux OpenConnect instructions at | |
# http://www.oit.uci.edu/kb/vpn-linux/ | |
# | |
# Jeff Stern | |
# 10/21/2015 | |
# possible values for VPNGRP: | |
# Default-WebVPN | |
# Merage | |
# MerageFull | |
# UCI <--- this will use the VPN address only for connections to UCI. all other connections | |
# will use your outside address | |
# UCIFull <--- this will use the VPN address for all connections | |
VPNGRP=ISU | |
# your ucinetid (all lower-case) | |
VPNUSER=nkarasch | |
# ============================================================================= | |
# you shouldn't have to change anything below here | |
VPNURL=https://vpn.iastate.edu | |
VPNSCRIPT=/usr/share/vpnc-scripts/vpnc-script | |
sudo openvpn --mktun --dev tun1 && \ | |
sudo ifconfig tun1 up && \ | |
sudo /usr/sbin/openconnect -s $VPNSCRIPT $VPNURL --user=$VPNUSER --authgroup=$VPNGRP --interface=tun1 | |
sudo ifconfig tun1 down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: Make sure to install
openvpn
first.