LoginSignup
108
121

More than 5 years have passed since last update.

MacのVPNサーバー機能

Last updated at Posted at 2015-01-05

MacでVirtualPrivateNetwork


使便

VPNmacL2PT,PPTP使vpndMacGUITerminalVPN

GUI


VPNVPN Activatar


man vpndvpndplist
man vpnd -s 5plist

vpndLibrary/Preferences/SystemConfiguration/com.apple.RemoteAccessServers.plist
man

2L2TP over IPSecPPTP使L2TP256bitPPTP2PPTP128bit



VPNDVPNDVPNPPPDPPPD
PPPD/etc/ppp/

VPNDplistMSCHAPv2使


/etc/ppp/users.plist
users.plist
<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
         <key>Password</key>
         <string><!-- パスワード --></string>
         <key>User</key>
         <string><!-- ユーザー名 --></string>
 </dict>
 </plist>




sudo vpnd

launchctl


launchctl
/etc/hostconfigVPN/etclaunchctl使

root/Library/LaunchDaemonscom.apple.vpnd.plist:644 root:wheel 
com.apple.vpnd.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Disabled</key>
        <false/>
        <key>Label</key>
        <string>com.apple.vpnd</string>
        <key>Program</key>
        <string>/usr/sbin/vpnd</string>
        <key>ProgramArguments</key>
        <array>
                <string>/usr/sbin/vpnd</string>
                <string>-x</string>
                <string>-i</string>
                <string>com.apple.ppp.l2tp</string>
        </array>
        <key>KeepAlive</key>
        <true/>
        <key>RunAtLoad</key>
        <true/>    
</dict>
</plist>

あとは
sudo launchctl load /Library/LaunchDaemons/com.apple.vpnd.plist
を実行すればOKです。

なぜこれを書いたか

VPNActivatorを使ってたんだけど、なんか自前で同じことをしたくなって設定ファイルを探し始めたら思ったよりめんどくさかったから

108
121
4

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
108
121