/sc_assets/441/logo.png

OSX: OpenVPN error: write UDPv4: Can't assign requested address (code=49)

Last updated by Shayne M on May 21, 2013 18:32

Problem

On Max OS X, when trying to connect to an OpenVPN gateway, you may encounter the following error:
2010-01-21 05:14:59 write UDPv4: Can't assign requested address (code=49)
2010-01-21 05:15:01 write UDPv4: Can't assign requested address (code=49)
...

The error would repeat itself indefinitely.

Root Cause

The TCP stack of the Mac has a bug that can cause the routing table to get corrupted.

Solution

The routing table needs to be flushed on the interface used to connect to the Internet. Typically,

  • en0: ethernet (wired) interface
  • en1: wlan (wireless) interface
The easiest way is to flush the routes is to reboot. The elegant way however is to shut down the interface connecting the Mac to the Internet, flush the routing table, and bring the interface back up. For example, assuming a wired connection, open a terminal (Finder -> Applications -> Utilities -> Terminal) or an X11 xterm window and issue the following commands:

sudo ifconfig en0 down
sudo route flush
sudo ifconfig en0 up
In case the command line hangs after the flush command, just open a new terminal and run the last command from there. When you are done, you can close all terminals. If you are connecting with wireless, replace en0 with en1.

VPNSecure Provides Secure VPN servers in over 45+ Countries

If you are a looking for a versatile easy to use VPN service, checkout Today