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) interfaceen1
: wlan (wireless) interface
sudo ifconfig en0 down
sudo route flush
sudo ifconfig en0 up
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