VPN接続時のMTU値のデフォルトは1500のため、環境によっては正常にパケットが到達しません。
自動的にMTU値とついでにルーティングが設定されるようにします。
How to
-
/etc/ppp/ip-up を作成します。
$ sudo vi /etc/ppp/ip-up $ cat /etc/ppp/ip-up #!/bin/bash # # Script which handles the routing issues as necessary for pppd # Only the link to Newman requires this handling. # # When the ppp link comes up, this script is called with the following # parameters # $1 the interface name used by pppd (e.g. ppp3) # $2 the tty device name # $3 the tty device speed # $4 the local IP address for the interface # $5 the remote IP address # $6 the parameter specified by the 'ipparam' option to pppd # case "$5" in <接続先のIPアドレス>) /sbin/ifconfig $1 mtu 1300 /sbin/route -nv add -net 192.168.0.0/24 -interface $1 ;; *) ;; esac exit 0 # EOF
接続先のIPアドレスはVPN接続後にifconfigで確認できます。
-
実行権限を付けます。
$ sudo chmod a+x /etc/ppp/ip-up
後は、VPNに接続すると自動的に設定されます。