Ubuntu how to setup a vpn connection, tsocks, corporate wifi with openconnect and openvpn or socks

These are just notes.

Cisco vpn setup [corporate setup]

# install
sudo apt-get install openconnect network-manager-openconnect-gnome

VPN GUI setup
# select dynamic updates
sudo dpkg-reconfigure resolvconf

#restart network-manager or reboot the laptop

#  create a new VPN openconnect connection, set only the gateway

Gnome network manager GUI configuration

[This is not needed for Ubuntu 15.04 and 16.10]. The default routing rules are missing in ubuntu openconnect 15.10/16.04. After the network manager establishes the connection, the work around is to add a default route as specified below after the connection is established. Start a console and type the command below with the correct arguments.

sudo route add default netmask gw dev vpn0

run ifconfig to figure out the vpn device name, the gateway ip of the vpn device normally tun0 or vpn0.

Execute the command above and the default route should make the openconnect vpn work.

Command line without network manager

# open a connection, use --background to run as daemon
sudo openconnect --user=USERID server/group/

# to stop the connection you can ctrl-c the terminal running openconnect or

sudo killall openconnect*

Setup openvpn using ibvpn.com provider and openvpn

sudo apt-get install openvpn easy-rsa network-manager-openvpn-gnome

goto http://www.ibvpn.com

setup a free account

extract openvpn.tgz where you want

On UbuntuGnome goto settings->network->add
select vpn->Import from file

Select ibVPN-US-Dallas.ovpn

Type your email
Get the password from the ibvpn website, this is not you ibvpn account password.

Select Add.
And try it out.

Using  a socks proxy instead of VPN

# run a local socks server
ssh -D 9999 proxy.server

# setweb browser proxy or gnome network proxy in gnome network settings.
proxy: localhost:9999

# To use other apps with socks install
sudo apt-get install tsocks

# Change config file to (remove everything else)
server =
server_port = 9999

# ssh to a machine
tsocks ssh -X bla.corp.com

# eclipse to a machine
tsocks eclipse


Popular Posts