VPNC ssh session stalls or hangs when running `ls -la`

Posted on June 13, 2012

tl;dr

Your MTU for your interface is incorrectly set.

“root@noc:/# vpnc yourcompany
Enter password for admin@xxx.xxx.xxx.xxx:
VPNC started in background (pid: 8444)…
root@noc:/#

Problem: MTU size missconfiguration

After you finally establish connection with your remote site you could
end up with successfull connection but as soon as you try to open some
file, or issue simple # ps aux command you get session freeze and you
are foced to close session. This is the MTU size missmatch. As you may
notice after creating vpnc connection you will get new interface that
is probably called tun0. Check out MTU size on that interface:

root@noc:/# ifconfig tun0

tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:xxx.xxx.xxx.xxx P-t-P:xxx.xxx.xxx.xxx Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1412 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

Try with default VPN MTU of 1300 by entering this line:

root@noc:/# ifconfig tun0 mtu 1300

Now check the state of MTU value, should be changed to 1300:

root@noc:/# ifconfig tun0
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:xxx.xxx.xxx.xxx P-t-P:xxx.xxx.xxx.xxx Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1300 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:746 (746.0 b) TX bytes:4447 (4.3 KB)

and you are ready to rock. If your company for what ever reason is
using different MTU size, you could consult your cisco admin or some
other person responsible for network configuration and administration.
There are other options for discovery of remote MTU but they are out of
the scope of this text.”

source = http://www.gerzic.net/docs/vpnc-tips.txt