各拠点の機器構成を下図に示します。子拠点はA, Bの2拠点ありますが、
各子拠点のIPアドレスの相違及びそれに対応するコンフィグを除き、同一の設定です。
文中の" : "のついた英数字(例S-1:)は機器の識別子として、図中の英数字と対応しています。

実際のネットワーク環境に併せて変更する必要のあるIPアドレス情報を下記に示します。
※10.x.xx.xxx:太字のアドレスはISPから割り当てられたグローバルアドレスです。
| I/F | Address | 備考 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| lan0 | 192.168.0.1/24 | 親拠点のLAN側ローカル | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| lan1 | 10.0.0.2/29 | 親拠点のWAN側グローバル | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ipsec0 | unnumbered | 子拠点Aとのトンネル | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ipsec1 | unnumbered | 子拠点Bとのトンネル |
| I/F | Address | 備考 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| lan0 | 10.0.0.1/29 | インターネットへのゲートウェイ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pppoe0 | unnumbered | 接続サービスに依存 |
| I/F | Address | 備考 |
|---|---|---|
| lan0 | 192.168.0.2/24 | LAN内へのゲートウェイ |
| lan1 | 10.0.0.3/29 | WAN側グローバル |
| I/F | Address | 備考 |
|---|---|---|
| lan0 | 192.168.1.1/24 | 子拠点AのLAN側のローカル |
| pppoe0 | 10.0.1.1/32 | 子拠点AのWAN側グローバル |
| ipsec0 | unnumbered | 親拠点とのトンネル |
| I/F | Address | 備考 |
|---|---|---|
| lan0 | 192.168.2.1/24 | 子拠点BのLAN側ローカル |
| pppoe0 | 10.0.2.1/32 | 子拠点BのWAN側グローバル |
| ipsec0 | unnumbered | 親拠点とのトンネル |
| I/F | Address | 備考 |
|---|---|---|
| --- | 172.31.0.1 | ホストAのグローバルアドレス |
| --- | 172.31.1.1 | ホストBのグローバルアドレス |
| I/F | Address | 備考 |
|---|---|---|
| --- | 10.123.0.1 | インターネット上のNTPサーバ |
ここでは、以下の機器について設定内容を解説します。
1| hostname "Center" 2| timezone "Japan" 3| environment login-timer 300 4| option ip monitor-linkstate on 5| option ip redirects off 6| interface lan0 media auto 7| interface lan0 add 192.168.0.1/24 8| interface lan1 media auto 9| interface lan1 queue normal 10| interface lan1 add 10.0.0.2/29 11| interface lan2 media auto 12| interface ipsec0 tunnel 10.0.0.2 10.0.1.1 13| interface ipsec0 mtu 1500 14| interface ipsec0 tcp-mss 1358 15| interface ipsec0 unnumbered 16| interface ipsec1 tunnel 10.0.0.2 10.0.2.1 17| interface ipsec1 mtu 1500 18| interface ipsec1 tcp-mss 1358 19| interface ipsec1 unnumbered 20| bridge disable 21| bridge ip-bridging on 22| bridge ipv6-bridging on 23| route add default 192.168.0.2 24| route add 10.123.0.1/32 10.0.0.1 25| route add 172.31.0.1/32 10.0.0.1 26| route add 172.31.1.1/32 10.0.0.1 27| route add 10.0.1.1/32 10.0.0.1 28| route add 10.0.2.1/32 10.0.0.1 29| route add 192.168.1.0/24 ipsec0 30| route add 192.168.2.0/24 ipsec0 31| route dynamic rip disable 32| route dynamic ospf disable 33| route dynamic redistribute static-to-rip disable 34| route dynamic redistribute static-to-ospf disable 35| route dynamic redistribute ospf-to-rip disable 36| route dynamic redistribute rip-to-ospf disable 37| route dynamic redistribute connected-to-rip enable 38| route dynamic redistribute connected-to-ospf enable 39| route dynamic pim-sparse disable 40| route6 dynamic ripng disable 41| route6 dynamic redistribute static-to-ripng disable 42| route6 dynamic redistribute connected-to-ripng enable 43| route6 dynamic pim-sparse disable 44| filter add Operation01 interface lan1 direction in action pass protocol 50 src 10.0.1.1/32 dst 10.0.0.2/32 state disable logging on enable 45| filter add Operation02 interface lan1 direction in action pass protocol 50 src 10.0.2.1/32 dst 10.0.0.2/32 state disable logging on enable 46| filter add Operation03 interface lan1 direction in action pass protocol tcpudp src 10.0.1.1/32 srcport 500 dst 10.0.0.2/32 dstport 500 state disable logging on enable 47| filter add Operation04 interface lan1 direction in action pass protocol tcpudp src 10.0.2.1/32 srcport 500 dst 10.0.0.2/32 dstport 500 state disable logging on enable 48| filter add Operation05 interface lan1 direction in action pass protocol tcp src 172.31.0.1/32 srcport 0-65535 dstport 22-23 state disable logging on enable 49| filter add Operation06 interface lan1 direction in action pass protocol tcp src 172.31.1.1/32 srcport 0-65535 dstport 22-23 state disable logging on enable 50| filter add Operation07 interface lan1 direction in action pass protocol tcp src 10.123.0.1/32 srcport 0-65535 dstport 123 state disable logging off enable 51| filter add Deny01 interface lan1 direction in action block state disable logging on enable 52| nat timeout 900 53| nat logging off 54| nat upnp off 55| nat upnp interface lan1 56| dhcp disable 57| dhcp mode server 58| dns forwarder disable 59| ntp enable 60| ntp server add 10.123.0.1 61| ike interval 40s phase1-timeout 01m phase2-timeout 02m20s 62| ike auto-initiation enable 63| ike preshared-key add 10.0.1.1 "IKEpresharedKEY" 64| ike preshared-key add 10.0.2.1 "IKEpresharedKEY" 65| ike proposal add IKEP01 encryption 3des hash sha1 authentication preshared-key dh-group modp1024 lifetime-of-time 1d 66| ike peer add EdgeA address 10.0.1.1 exchange-mode main proposals IKEP01 tunnel-interface enable 67| ike peer add EdgeB address 10.0.2.1 exchange-mode main proposals IKEP01 tunnel-interface enable 68| ipsec security-association proposal add SAP01 pfs-group modp1024 authentication-algorithm hmac-sha1 encryption-algorithm 3des lifetime-of-time 03h 69| ipsec security-association add EdgeA tunnel-interface ipsec0 ike SAP01 esp enable 70| ipsec security-association add EdgeB tunnel-interface ipsec1 ike SAP01 esp enable 71| cbq link-bandwidth 100Mbps 72| snmp disable 73| snmp community "public" 74| snmp trap disable 75| syslog debug-level off 76| syslog facility local1 77| syslog remote off 78| translator timeout 300 79| encrypted-password admin ADMINPASSWD 80| encrypted-password user USERPASSWD 81| resolver disable 82| rtadvd disable 83| httpd disable 84| sshd hostkey rsa1 auto 85| sshd hostkey rsa none 86| sshd hostkey dsa none 87| sshd enable 88| telnetd disable 89| remote-console disable 90| vendor OEM
- tunnel始点はVPN親機C:のWAN側グローバルアドレス、終点はVPN子機A:のWAN側グローバルアドレスを設定します。
- mtuIPsecインターフェイスのMTUを指定します。
- tcp-mssIPsecインターフェイスのTCP MSS調整値を指定します。 フレッツ回線は1358、専用線接続やYahoo!BBは1460、それら以外(不明な場合を含む)は1280を指定します。
- unnumberedIPsecインターフェイスにはIPアドレスを付与せずunnumberedとします。
- add default 192.168.0.2VPN親機C:のデフォルト経路は、ファイアウォールのLAN側へ向けます。
- add 10.0.1.1/32 10.0.0.1 add 10.0.2.1/32 10.0.0.1VPN子機A:及びB:のグローバルアドレス(IPsecインターフェイスのトンネル終点)宛の経路を インターネット接続ルータのアドレスへ向けます。
- add 192.168.1.0/24 ipsec0 add 192.168.2.0/24 ipsec0子拠点A及び子拠点BのLAN側ローカルネットワーク宛の経路をIPsecインターフェイスへ向けます。
- add 10.123.0.1/32 10.0.0.1 add 172.31.0.1/32 10.0.0.1 add 172.31.1.1/32 10.0.0.1NTPサーバ及び管理ホスト宛の経路をインターネット接続ルータのアドレスへ向けます。
- add Operation01 add Operation02 add Operation03 add Operation04 add Operation05 add Operation06 add Operation07 add Deny01親・子拠点間をつなぐIPsecパケット、管理ホストによるTelnet・SSH、NTPサーバによるアクセスはPass、その他すべての通信はBlockします。
| I/F | direction | action | protocol | src : srcport | dst : dstport |
|---|---|---|---|---|---|
| lan1 | in | pass | 50(esp) | 10.0.1.1/32 : --- | 10.0.0.2/32 : --- |
| lan1 | in | pass | 50(esp) | 10.0.2.1/32 : --- | 10.0.0.2/32 : --- |
| lan1 | in | pass | tcpudp | 10.0.1.1/32 : 500 | 10.0.0.2/32 : 500 |
| lan1 | in | pass | tcpudp | 10.0.2.1/32 : 500 | 10.0.0.2/32 : 500 |
| lan1 | in | pass | tcp | 172.31.0.1/32 : 0-65535 | --- : 22-23 |
| lan1 | in | pass | tcp | 172.31.1.1/32 : 0-65535 | --- : 22-23 |
| lan1 | in | pass | tcp | 10.123.0.1/32 : 0-65535 | --- : 123 |
| lan1 | in | block | --- | --- : --- | --- : --- |
1| hostname "EdgeA" 2| timezone "Japan" 3| environment login-timer 300 4| option ip monitor-linkstate on 5| option ip redirects off 6| ppp add IIJ keepalive 30 ipcp enable ipcp-address on ipcp-dns on ipv6cp disable authentication-method chap identifier pppaccount1@example.jp passphrase PPPPASSWD tcp-mss auto 7| interface lan0 media auto 8| interface lan0 add 192.168.1.1/24 9| interface lan1 media auto 10| interface lan1 queue normal 11| interface pppoe0 over lan1 12| interface pppoe0 ppp-configuration IIJ 13| interface ipsec0 tunnel 10.0.1.1 10.0.0.2 14| interface ipsec0 mtu 1500 15| interface ipsec0 tcp-mss 1358 16| interface ipsec0 unnumbered 17| bridge disable 18| bridge ip-bridging on 19| bridge ipv6-bridging on 20| route add default ipsec0 21| route add 10.123.0.1/32 pppoe0 22| route add 172.31.0.1/32 pppoe0 23| route add 172.31.1.1/32 pppoe0 24| route add 10.0.0.2/32 pppoe0 25| route dynamic rip disable 26| route dynamic ospf disable 27| route dynamic redistribute static-to-rip disable 28| route dynamic redistribute static-to-ospf disable 29| route dynamic redistribute ospf-to-rip disable 30| route dynamic redistribute rip-to-ospf disable 31| route dynamic redistribute connected-to-rip enable 32| route dynamic redistribute connected-to-ospf enable 33| route dynamic pim-sparse disable 34| route6 dynamic ripng disable 35| route6 dynamic redistribute static-to-ripng disable 36| route6 dynamic redistribute connected-to-ripng enable 37| route6 dynamic pim-sparse disable 38| filter add Operation01 interface pppoe0 direction in action pass protocol 50 src 10.0.0.2/32 dst 10.0.1.1/32 state disable logging on enable 39| filter add Operation02 interface pppoe0 direction in action pass protocol tcpudp src 10.0.0.2/32 srcport 500 dst 10.0.1.1/32 dstport 500 state disable logging on enable 40| filter add Operation03 interface pppoe0 direction in action pass protocol tcp src 172.31.0.1/32 srcport 0-65535 dstport 22-23 state disable logging on enable 41| filter add Operation04 interface pppoe0 direction in action pass protocol tcp src 172.31.1.1/32 srcport 0-65535 dstport 22-23 state disable logging on enable 42| filter add Operation05 interface pppoe0 direction in action pass protocol tcp src 10.123.0.1/32 srcport 0-65535 dstport 123 state disable logging off enable 43| filter add Deny01 interface pppoe0 direction in action block state disable logging on enable 44| nat timeout 900 45| nat logging off 46| nat upnp off 47| nat upnp interface lan1 48| dhcp disable 49| dhcp mode server 50| dns forwarder disable 51| ntp enable 52| ntp server add 10.123.0.1 53| ike interval 40s phase1-timeout 01m phase2-timeout 02m20s 54| ike auto-initiation enable 55| ike preshared-key add 10.0.0.2 "IKEpresharedKEY" 56| ike proposal add IKEP01 encryption 3des hash sha1 authentication preshared-key dh-group modp1024 lifetime-of-time 1d 57| ike peer add Center address 10.0.0.2 exchange-mode main proposals IKEP01 tunnel-interface enable 58| ipsec security-association proposal add SAP01 pfs-group modp1024 authentication-algorithm hmac-sha1 encryption-algorithm 3des lifetime-of-time 03h 59| ipsec security-association add Center tunnel-interface ipsec0 ike SAP01 esp enable 59| cbq link-bandwidth 10Mbps 60| snmp disable 61| snmp community "public" 62| snmp trap disable 63| syslog debug-level off 64| syslog facility local1 65| syslog remote off 66| translator timeout 300 67| encrypted-password admin ADMINPASSWD 68| encrypted-password user USERPASSWD 69| resolver disable 70| rtadvd disable 71| httpd disable 72| sshd hostkey rsa1 auto 73| sshd hostkey rsa none 74| sshd hostkey dsa none 75| sshd enable 76| telnetd disable 77| remote-console disable 78| vendor OEM
- add default ipsec0VPN子機のデフォルト経路はVPN親機とトンネルを張るIPsecインターフェイスへ向けます。 他の拠点宛の通信やインターネット上のホストへの通信も、VPN越しに親拠点を経由して行います。
- add 10.0.0.2/32 pppoe0IPsecトンネルの終端(親機のWAN側グローバルアドレス)宛の経路は インターネット(PPPoEインターフェイス)へ向けます。 デフォルト経路のみの設定では、IPsec通信を確立するための通信も未確立の IPsecインターフェイスへ向けられIPsec通信が確立しません。
- add 10.123.0.1/32 pppoe0 add 172.31.0.1/32 pppoe0 add 172.31.1.1/32 pppoe0NTPサーバ及び管理ホスト宛の経路はインターネット(PPPoEインターフェイス)へ向けます。
1| hostname "EdgeB" 2| timezone "Japan" 3| environment login-timer 300 4| option ip monitor-linkstate on 5| option ip redirects off 6| ppp add IIJ keepalive 30 ipcp enable ipcp-address on ipcp-dns on ipv6cp disable authentication-method chap identifier pppaccount2@example.jp passphrase PPPPASSWD tcp-mss auto 7| interface lan0 media auto 8| interface lan0 add 192.168.2.1/24 9| interface lan1 media auto 10| interface lan1 queue normal 11| interface pppoe0 over lan1 12| interface pppoe0 ppp-configuration IIJ 13| interface ipsec0 tunnel 10.0.2.1 10.0.0.2 14| interface ipsec0 mtu 1500 15| interface ipsec0 tcp-mss 1358 16| interface ipsec0 unnumbered 17| bridge disable 18| bridge ip-bridging on 19| bridge ipv6-bridging on 20| route add default ipsec0 21| route add 10.123.0.1/32 pppoe0 22| route add 172.31.0.1/32 pppoe0 23| route add 172.31.1.1/32 pppoe0 24| route add 10.0.0.2/32 pppoe0 25| route dynamic rip disable 26| route dynamic ospf disable 27| route dynamic redistribute static-to-rip disable 28| route dynamic redistribute static-to-ospf disable 29| route dynamic redistribute ospf-to-rip disable 30| route dynamic redistribute rip-to-ospf disable 31| route dynamic redistribute connected-to-rip enable 32| route dynamic redistribute connected-to-ospf enable 33| route dynamic pim-sparse disable 34| route6 dynamic ripng disable 35| route6 dynamic redistribute static-to-ripng disable 36| route6 dynamic redistribute connected-to-ripng enable 37| route6 dynamic pim-sparse disable 38| filter add Operation01 interface pppoe0 direction in action pass protocol 50 src 10.0.0.2/32 dst 10.0.2.1/32 state disable logging on enable 39| filter add Operation02 interface pppoe0 direction in action pass protocol tcpudp src 10.0.0.2/32 srcport 500 dst 10.0.2.1/32 dstport 500 state disable logging on enable 40| filter add Operation03 interface pppoe0 direction in action pass protocol tcp src 172.31.0.1/32 srcport 0-65535 dstport 22-23 state disable logging on enable 41| filter add Operation04 interface pppoe0 direction in action pass protocol tcp src 172.31.1.1/32 srcport 0-65535 dstport 22-23 state disable logging on enable 42| filter add Operation05 interface pppoe0 direction in action pass protocol tcp src 10.123.0.1/32 srcport 0-65535 dstport 123 state disable logging off enable 43| filter add Deny01 interface pppoe0 direction in action block state disable logging on enable 44| nat timeout 900 45| nat logging off 46| nat upnp off 47| nat upnp interface lan1 48| dhcp disable 49| dhcp mode server 50| dns forwarder disable 51| ntp enable 52| ntp server add 10.123.0.1 53| ike interval 40s phase1-timeout 01m phase2-timeout 02m20s 54| ike auto-initiation enable 55| ike preshared-key add 10.0.0.2 "IKEpresharedKEY" 56| ike proposal add IKEP01 encryption 3des hash sha1 authentication preshared-key dh-group modp1024 lifetime-of-time 1d 57| ike peer add Center address 10.0.0.2 exchange-mode main proposals IKEP01 tunnel-interface enable 58| ipsec security-association proposal add SAP01 pfs-group modp1024 authentication-algorithm hmac-sha1 encryption-algorithm 3des lifetime-of-time 03h 59| ipsec security-association add Center tunnel-interface ipsec0 ike SAP01 esp enable 60| cbq link-bandwidth 10Mbps 61| snmp disable 62| snmp community "public" 63| snmp trap disable 64| syslog debug-level off 65| syslog facility local1 66| syslog remote off 67| translator timeout 300 68| encrypted-password admin ADMINPASSWD 69| encrypted-password user USERPASSWD 70| resolver disable 71| rtadvd disable 72| httpd disable 73| sshd hostkey rsa1 auto 74| sshd hostkey rsa none 75| sshd hostkey dsa none 76| sshd enable 77| telnetd disable 79| remote-console disable 80| vendor OEM
※ 設置される順序や構成に併せた順序で確認してください。