Commandline OpenVPN client on Mac OSX with macports

发布时间:2017-7-9 7:29:52编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"Commandline OpenVPN client on Mac OSX with macports ",主要涉及到Commandline OpenVPN client on Mac OSX with macports 方面的内容,对于Commandline OpenVPN client on Mac OSX with macports 感兴趣的同学可以参考一下。

http://www.tuicool.com/articles/FjuyQj  注:文中有些内容做了修改,特别是那个配置文件,不能直接抄着用。

Most people use TunnelBrick to setup OpenVPN client connections on Mac OSX, i prefer using the command line.

To get OpenVPN up and running off the command line is a simple process. The commands below need to be run as a privileged user if your root account is not enabled use sudo to run the commands.

Install OpenVPN

To install OpenVPN 2 from macports run:

sudo port install openvpn2

Install TunTap

To install TunTap from macports run:

sudo port install tuntaposx

Configure it to startup at boot:

sudo launchctl load -w /Library/LaunchDaemons/org.macports.tuntaposx.plist

You need TunTap as it allows you to create virtual interfaces using the supplied kernel extensions. If you don't install TunTap you will get the error Cannot allocate TUN/TAP dev dynamically when you try and make a OpenVPN connection.

Configuration

Create a directory to hold your configuration and keys.

mkdir /opt/local/etc/openvpn

Place your keys and configuration files in /opt/local/etc/openvpn/

A sample client configuration is provided below.

client
dev tun
proto tcp
remote vpn.home.topdog-software.com 1194
nobind
resolv-retry infinite
tls-client
ca /opt/local/etc/openvpn/ca.crt
cert /opt/local/etc/openvpn/client.crt
key /opt/local/etc/openvpn/client.key
ns-cert-type server
cipher BF-CBC
tls-cipher DHE-RSA-AES256-SHA
tls-remote vpn.home.topdog-software.com
tls-auth /opt/local/etc/openvpn/tls-auth.key 1
remote-cert-tls server
comp-lzo
persist-key
persist-tun
mute-replay-warnings
verb 3
mlock

Connecting

To connect simply run:

sudo openvpn --config /opt/local/etc/openvpn/openvpn.conf

 


上一篇:ASP.NET Core Web API 最小化项目
下一篇:[Leetcode]-Reverse Bits

相关文章

相关评论

本站评论功能暂时取消,后续此功能例行通知。

一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!

二、互相尊重,对自己的言论和行为负责。

最近更新

好贷网好贷款