0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

MacのVPNで特定のIPアドレスだけVPNを利用できる様にする

Posted at

VPN設定

VPN設定で
「すべてのトラフィックをVPN接続経由で送信」
は外す。

Interface確認

以下のコマンドで、VPN接続のinterfaceを確認

ifconfig

経路設定

以下のファイルで、VPN接続のinterface「ppp0」に向けるIPアドレスを指定する。

/etc/ppp/ip-up
#!/bin/sh

if [ "$1" = "ppp0" ]; then
    /sbin/route add -net 172.31.0.0/16 -interface ppp0
    /sbin/route add -net 192.168.1.0/24 -interface ppp0
    /sbin/route add -net 192.168.2.0/24 -interface ppp0
    /sbin/route add -net 192.168.3.0/24 -interface ppp0
    /sbin/route add -net 192.168.4.0/24 -interface ppp0
fi

参考

0
1
0

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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?