Skip to content

Instantly share code, notes, and snippets.

@isdyy
Created April 12, 2013 10:50
Show Gist options
  • Save isdyy/5371215 to your computer and use it in GitHub Desktop.
Save isdyy/5371215 to your computer and use it in GitHub Desktop.
OSX で VPN接続中に特定IPへのアクセスをVPN経由にする
#!/bin/sh
# For OSX VPN custom routing
#
# Place this file at /etc/ppp/ip-up, edit its CIDRs, and enter following:
# shell> sudo chmod +x /etc/ppp/ip-up
# VPN gateway
if [ "${5:-}" = "192.168.100.1" ]
then
# example 01
/sbin/route add 192.0.2.0/24 $5
# example 02
/sbin/route add 198.51.100.1/32 $5
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment