Mac OS X: OpenVPN error: write UDPv4: Can't assign requested address (code=49)
When using OpenVPN in Mac OS X, you may encounter the problem:
Mac cannot connect to server, while other devices in the same LAN, even the Windows VM in this OS X works fine. It works again after reboot.
If you check the log, you may see this:
OpenVPN error: write UDPv4: Can’t assign requested address (code=49)
I used to reboot to solve this. But there is a better quicker way, provide by anuson.com
- Open a Terminal window. (Found in Applications -> Utilities.)
- Enter the following commands:
- sudo ifconfig en1 down
- sudo route flush
- sudo ifconfig en1 up
- Please make sure to replace en1 with your actual Internet interface.
- If you don’t know which en interface is your Internet interface you can do a:
- sudo ifconfig
- To get an overview and figure our which en interface is your Internet interface.