Ubuntu – Why is port 500 in use and how can I free it? VPNC error

cisco-vpn-clientnetworkingubuntu-10.10vpnvpnc

I tried to use NetworkManager to connect to my university's VPN, but it didn't work.
Then I used a command line vpnc:

> sudo vpnc
[sudo] password for kirill: 
Enter IPSec gateway address: vpn.net.**.edu
Enter IPSec ID for vpn.net.**.edu: **
Enter IPSec secret for **@vpn.net.**.edu: 
Enter username for vpn.net.**.edu: **
Enter password for **@vpn.net.**.edu: 
vpnc: Error binding to source port. Try '--local-port 0'
Failed to bind to 0.0.0.0:500: Address already in use

Then I did

sudo vpnc –local-port 0

with the same configuration, and it all worked.

I'd like to be able to use the NetworkManager GUI to connect to VPN. I wanted to find out which program uses port 500:

> sudo netstat -a |grep 500
tcp        0      0 *:17500                 *:*                     LISTEN     
udp        0      0 *:4500                  *:*                                
udp        0      0 *:17500                 *:*                                
unix  3      [ ]         STREAM     CONNECTED     63500    
unix  3      [ ]         STREAM     CONNECTED     12500    @/tmp/.X11-unix/X0

There is nothing that uses 50.

I'm using Ubuntu 10.10 on a ThinkPad X201.

Best Answer

UDP port 500 is used by ISAKMP, the IPsec key exchange protocol.

If netstat does not list the port as in use, try vpnc again after waiting a minute or so.

Related Question