virtual network interfaces multiple vpn connections

1

I have 2 vpn connections and I want to be able to connect on both of them at the same time, running Fedora 18. My main idea was to run VirtualBox with 2 virtual machines, connect each of them on the VPN and then SSH to each machine to access both VPNs. But then I thought there must be a way to do it in one machine. I mean there's no point of running a whole operating system just to get 1 connection.

I am aware of nm-tool but I think if I connect a VPN it "wraps" all the connections. Is that right? Is there a way to create, lets say, eth1 eth2 or eth0:1 eth0:2 and assign 1 VPN on each?

If there is no possible way of doing it in one machine and I have to stick to the VM solution, what configuration would you recommend to use less hardware resources? (distribution, ram assigned, etc.) hence if I stick to the VM solution I would only need the VM for the connection and nothing else.

(Any solutions are accepted, but I prefer command line if possible.)

user2011809

Posted 2013-01-26T11:14:24.060

Reputation: 13

Answers

0

Use vpnc. This does not wrap all connections, but adds a new interface for the vpn.

You will create a new file in /etc/vpnc/ for each configuration. There is a default.conf file as an example, with everything commented out.

If you have vpn1.conf and vpn2.conf in that directory, you'll start the vpns with the commands vpnc vpn1 and vpnc vpn2 (or perhaps something like vpnc --enable-1des vpn1 -- see the manual page for vpnc).

I recommend making /etc/resolv.conf immutable when using vpnc as it will overwrite it. I usually don't want the vpn dns, and if you have two, it is sure to be unhelpful.

Matthew Lundberg

Posted 2013-01-26T11:14:24.060

Reputation: 202

thx a lot for your reply. My bad i should mention i am using openvpn. But your answer made me understand it's a vpn client issure rather than os issue. So i can do something like: sudo openvpn --mktun --dev tun2 sudo ip link set tun2 up ifconfig now gives a tun2

found this information here: [link]http://backreference.org/2010/03/26/tuntap-interface-tutorial/

– user2011809 – 2013-01-26T23:52:18.157