Posts: 1
Joined: Sun May 12, 2013 11:52 pm

Raspbian, Wifi, and VPNC?

Mon May 13, 2013 12:03 am

I am fairly new to using Raspbian, and I have moderate experience using Linux distros (I am more skilled in Windows). I am having an issue that has me stumped. I have installed VPNC on Raspbian so I can connect to my work's Cisco VPN, and I am able to connect with no problems when I am using my eth0 connection. However, whenever I try to connect over wifi (wlan0), it immediately disconnects me from wifi and no connection is made. Looking at the logs, I am able to reach the VPN server, but my wifi seems to disconnect around the time that it asks for my VPN password. I am connecting to the VPN using IPSec with a group password. Anyone have any general ideas about what might be causing this? I can provide more detail, if needed. Thanks.


Posts: 15
Joined: Thu May 09, 2013 1:35 pm

Re: Raspbian, Wifi, and VPNC?

Mon May 13, 2013 4:37 am

Maybe check the MTU size ?

Posts: 1
Joined: Wed Jun 12, 2013 12:35 pm

Re: Raspbian, Wifi, and VPNC?

Wed Jun 12, 2013 12:38 pm


I've run into the same issue. Have you found a solution?



Posts: 1
Joined: Fri Jan 03, 2014 5:11 am

Re: Raspbian, Wifi, and VPNC?

Fri Feb 21, 2014 6:47 am

Any solution to get around this problem? I am seeing the same issue.

Posts: 2
Joined: Wed Jun 25, 2014 11:32 pm

Re: Raspbian, Wifi, and VPNC?

Wed Jun 25, 2014 11:50 pm

Here's a fix (Raspbian 3.10.25+):

1. sudo nano /etc/wpa_supplicant/
2. insert a new line in this shell script just after the PATH=... line. On this new line, type:
exit 0
(that's the numeral 0).
3. Control-O to save, Control-X to exit.

now the command
sudo vpnc <your conf file>
should execute without error, and the command ifconfig will show a new network interface tun0.
To disconnect, sudo vpnc-disconnect
at which point ifconfig should reveal that the tun0 interface is gone.

Why this works:
It's "too many cooks in the kitchen". Both wpa_supplicant and ifplugd handle network interfaces in Raspbian. The wireless, usually on wlan0, is a "roaming" device. The wpa_action shell script's job is to make sure only one "roaming device" is on line at a time. But when vpnc creates the virtual tunnel tun0, the wpa_action script decides that wlan0 is no longer needed, and downs it--- just about the time your vpn connection is about to go "live".

Inserting "exit 0" in the shell script effectively disables, so that BOTH wlan0 and tun0 are up simultaneously, which is what you want. If at some time (importance of vpn) < (importance of roaming) then just remove the line and you're back to stock behaviour. A more elegant fix would abort the "ifdown wlan0" only when tun0 is coming up, but hey this is fast and got me on vpn with the Pi/WiFi.

Posts: 1
Joined: Sun Jun 29, 2014 1:50 am

Re: Raspbian, Wifi, and VPNC?

Sun Jun 29, 2014 1:55 am

Thanks, profjws! I've been trying to resolve this same issue for a few hours now, and your solution did the trick.

Posts: 2
Joined: Wed Jun 25, 2014 11:32 pm

Re: Raspbian, Wifi, and VPNC?

Sun Aug 03, 2014 9:42 pm

Glad to hear it. I am way indebted to forums like this and glad to make a small contribution when I can... ;)

Return to “Raspberry Pi OS”