Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect to a VPN Connection in Ubuntu in bash

Tags:

linux

bash

vpn

How can I connect to a VPN Connection when I can use only bash (terminal)?

I create a connection but I want to connect or disconnect using remote ssh connection

like image 227
Hossein Nasr Avatar asked Aug 13 '13 08:08

Hossein Nasr


People also ask

How do I set up a VPN on Ubuntu?

In your Ubuntu desktop, go to “System Settings -> Network” 2. At the Network window, click the “+” button at the left bottom corner. 3. When prompted, select VPN for the interface dropdown. Click “Create”. 4. Select “PPTP” for the VPN connection type (in most cases, you should only have one option).

How to connect to OpenVPN on CentOS 8/ubuntu?

Follow the guide below to learn how to connect to OpenVPN server via the Network Manager; Connect to OpenVPN using Network Manager on CentOS 8/Ubuntu 18.04 Click on the connection icon at the top right corner on your Ubuntu system and click Edit Connections. You can as well launch the network manager connection editor by running the command below;

Why do I need a VPN on Ubuntu?

There are many reasons why you need to connect to a VPN. Maybe you need to connect to your office network so you can access some confidential files from your Home PC, or that you need an American IP to watch Hulu and listen to Pandora. Whatever the reason is, you can easily configure a VPN connection in Ubuntu and no extra installation is required.

How to configure OpenVPN to receive incoming connections on Linux?

You may need to install net-tools for the netstat command to work. Use this command: sudo apt install net-tools That’s all the configuration you’ll need to do for the OpenVPN Server. It should now be capable of receiving incoming connections.


2 Answers

you can use nmcli to do that. this program is use for network management.

nmcli con up id <name_of_connection>

you need to save the password of that connection before you use this command. For more information, try man nmcli

any help on how to create VPN_CONNECTION in bash and how to manage them will appreciate

like image 104
Hossein Nasr Avatar answered Oct 21 '22 10:10

Hossein Nasr


Install the packages

  sudo apt-get install vpnc network-manager-vpnc network-manager-vpnc-gnome

and then from bash you can try

vpnc-connect vpn.conf

you need to supply the vpn configuration file as argument.

like image 2
Knight71 Avatar answered Oct 21 '22 09:10

Knight71