InterLinkのMyIPサービスを使ってみる。

我が家のサーバで以前使っていたInterlinkさんの「MyIPサービス」を、YAMAHAのRT55iでも使用できるか実験してみました。

ちなみに、1週間だけですが無料でテスト用アカウントを貸し出してくれるようです。
良心的ですね。ということで実験してみました。
(ちなみに今は、MyIPサービスのようなVPNではなく、固定IPをプロバイダから頂いてます…。)

簡単ですが、我が家の環境はこんな感じ。192.168.100.1…ルータ
192.168.100.2…このwebなどを公開しているサーバ

192.168.100.1…ルータ
192.168.100.2…このwebなどを公開しているサーバ
ルータには事前に、動的なIPが付与されるプロバイダ情報が設定されているものとします。
ポイントは、サーバはVPN経由(固定IP)でインターネットへ行き、それ以外は動的なIPのほうへ経路を設定します。
…なんとなくかっこいいじゃないですか。(笑)

まず、テストアカウントを申し込むと、プロバイダからユーザID云々のかかれたメールが届くので、それを元にconfigを作成してみます。

## PP 2にVPNの要領でアカウントの定義
pp select 2
pp name WAN/VPN:InterLink2
pp bind tunnel 1
ip pp mtu 1280
ip pp nat descriptor 1100
pp auth accept chap mschap
pp auth myname (付与されたユーザID) (付与されたパスワード)
ppp ipcp ipaddress on
ppp ccp type mppe-any
pptp service type client
pp enable 2nat descriptor type 1100 masquerade
nat descriptor masquerade static 1100 1 192.168.100.2 tcp smtp,www,pop3,https,ftpdata-21,ftpdata
nat descriptor masquerade static 1100 2 192.168.100.2 tcp 22,domain
nat descriptor masquerade static 1100 3 192.168.100.2 udp 22,domain
## Tunnelの定義(PPTP)
tunnel select 1
tunnel encapsulation pptp
tunnel endpoint address (付与されたVPN接続先)
pptp tunnel disconnect time 600
pptp keepalive use off
tunnel enable 1

あとは、webサーバにきちんとデータが届くようにNATの定義をしてみます。

nat descriptor type 1100 masquerade
nat descriptor masquerade static 1100 1 192.168.100.2 tcp smtp,www,pop3,https,ftpdata-21,ftpdata
nat descriptor masquerade static 1100 2 192.168.100.2 tcp 22,domain
nat descriptor masquerade static 1100 3 192.168.100.2 udp 22,domain

最後に、webサーバは固定IP側のVPN経由へ行くように、DefaultGatewayの設定をします。

ip filter 501050 pass 192.168.100.2 * * * *
ip filter 501060 pass 192.168.100.1 * tcp,udp * smtp,pop3
ip route default gateway pp 1 filter 501060 gateway pp 2 filter 501050 gateway pp 1

あたりまえですが、webサーバのDefaultGatewayはルータ(192.168.100.1)にしておきます。
そうすると、固定IPでインターネットからアクセスを受けることが出来ます。
これでドメインを取得したり、遊べますねー。