Page top

OMRON

無停電電源装置Japan

オムロン ソーシアルソリューションズ株式会社

IP8環境でサーバ公開とVPNを併用したい

IP8環境でのVPN併用接続図

■説明

IP8/IP16サービスの環境でサーバにプライベートIPアドレスを割り当てて公開する設定例を紹介します。
プライベートネットワークはVPN(IPsec)接続します。
 ※アンナンバードを設定するとVPN(IPsec)接続が利用できません。

アンナンバード接続を行うことで、同一ポート番号を使用した同一サーバの公開をすることが可能です。
(例:TCP80番ポートを使用して、複数のWEBサーバを公開する)

アンナンバード設定をしたい(IP8/IP16環境で使用したい)

プロバイダとの契約で IP8:202.xx.xx.48/29 を利用できる場合の設定例です。
 202.xx.xx.49:プライベートネットワークがNAPTで使用するグローバルIPアドレス
 202.xx.xx.50:HTTPサーバで使用するグローバルIPアドレス
 202.xx.xx.51:FTPサーバで使用するグローバルIPアドレス
 202.xx.xx.52:メールサーバで使用するグローバルIPアドレス
 202.xx.xx.53:SSHサーバで使用するグローバルIPアドレス
 202.xx.xx.54:TELNETサーバで使用するグローバルIPアドレス

サーバはグローバルIPアドレスではなく固定プライベートIPアドレスを設定します。
NAT設定を使用してサーバのプライベートIPアドレスとグローバルIPアドレスを関連付けます。
サーバで使用するプロトコル/ポート番号を透過するフィルタを追加します。
NAPTを設定します。(NAT設定を追加すると出荷時の設定で動作しているNAPT設定は動作しません)

フィルタをプロトコルやポート番号で制限しないとき(グローバルIPアドレスとプライベートIPアドレスを一対一にNAT設定)は次の書式で設定してください。
 ip nat {NATテーブル番号} {プライベートIPアドレス}/* {グローバルIPアドレス} {インターフェース}
 例:ip nat 10 192.168.2.250/* 202.xx.xx.50 remote 0

※show config 実行時と「管理コマンド・設定(設定メンテナンス)」で初期値のパラメータは表示されません。

■設定内容・・・テキストファイルのダウンロードはこちら

ip address 192.168.2.1/24
ip dhcp address 192.168.2.100/99
ip dhcp server on
ip filter 1 pass in * 192.168.2.250/32 HTTP remote 0
ip filter 2 pass in * 192.168.2.251/32 FTP remote 0
ip filter 3 pass in * 192.168.2.252/32 POP3 remote 0
ip filter 4 pass in * 192.168.2.252/32 SMTP remote 0
ip filter 5 pass in * 192.168.2.253/32 SSH remote 0
ip filter 6 pass in * 192.168.2.254/32 TELNET remote 0
ip filter 59 reject out * 169.254.0.0/16 * wanany
ip filter 60 reject dns qtype 6
ip filter 61 restrict out * * tcpfin * * wanany
ip filter 62 restrict out * * NETBIOS wanany
ip filter 63 restrict out * * tcp_udp 137-139 * wanany
ip filter 64 restrict out * * udp 137 53 wanany
ip nat 1 192.168.2.250/HTTP 202.xx.xx.50 remote 0
ip nat 2 192.168.2.251/FTP 202.xx.xx.51 remote 0
ip nat 3 192.168.2.252/POP3 202.xx.xx.52 remote 0
ip nat 4 192.168.2.252/SMTP 202.xx.xx.52 remote 0
ip nat 5 192.168.2.253/SSH 202.xx.xx.53 remote 0
ip nat 6 192.168.2.254/TELNET 202.xx.xx.54 remote 0
ip nat 64 */* 202.xx.xx.49 remote 0
ip rip off
ip spi mode off
ip stealth mode off
ipsec mode on
ipsec 1 valid on
ipsec 1 policy localip 192.168.2.0/24
ipsec 1 policy remoteip 192.168.3.0/24
ipsec 1 policy dstgwip 43.xx.xx.116
ipsec 1 ike psk omrontest
ipsec 1 mss mode on
ipv6 common filter 1 pass in * * NDP_NS ether1 nolog
ipv6 common filter 2 pass out * * NDP_NS ether1 nolog
ipv6 common filter 3 pass in * * NDP_NA ether1 nolog
ipv6 common filter 4 pass out * * NDP_NA ether1 nolog
ipv6 common filter 5 pass in * * NDP_NS ether2 nolog
ipv6 common filter 6 pass out * * NDP_NS ether2 nolog
ipv6 common filter 7 pass in * * NDP_NA ether2 nolog
ipv6 common filter 8 pass out * * NDP_NA ether2 nolog
ipv6 common filter 9 pass in * * NDP_RS ether1 nolog
ipv6 common filter 10 pass out * * NDP_RA ether1 nolog
ipv6 common filter 11 pass in * * NDP_RS ether2 nolog
ipv6 common filter 12 pass out * * NDP_RA ether2 nolog
remote 0 disconnect idle 0
remote 0 pppoe keepalive on
remote 0 pppoe always on
remote 0 send id XXXX@omron.co.jp
remote 0 send password XXXX

■解説

ip filter 1 pass in * 192.168.2.250/32 HTTP remote 0
    remote 0 受信側:192.168.2.250 宛の HTTP を通します
    ※ip filter 1 pass in * 192.168.2.250/32 tcp * 80 remote 0 と同じ設定です
ip filter 2 pass in * 192.168.2.251/32 FTP remote 0
    remote 0 受信側:192.168.2.251 宛の FTP を通します
    ※ip filter 2 pass in * 192.168.2.251/32 tcp * 20-21 remote 0 と同じ設定です
ip filter 3 pass in * 192.168.2.252/32 POP3 remote 0
    remote 0 受信側:192.168.2.252 宛の POP3 を通します
    ※ip filter 3 pass in * 192.168.2.252/32 tcp * 110 remote 0 と同じ設定です
ip filter 4 pass in * 192.168.2.252/32 SMTP remote 0
    remote 0 受信側:192.168.2.252 宛の SMTP を通します
    ※ip filter 4 pass in * 192.168.2.252/32 tcp * 25 remote 0 と同じ設定です
ip filter 5 pass in * 192.168.2.253/32 SSH remote 0
    remote 0 受信側:192.168.2.253 宛の SSH を通します
   ※ip filter 5 pass in * 192.168.2.253/32 tcp_udp * 22 remote 0 と同じ設定です
ip filter 6 pass in * 192.168.2.254/32 TELNET remote 0
    remote 0 受信側:192.168.2.254 宛の TELNET を通します
    ※ip filter 6 pass in * 192.168.2.254/32 tcp * 23 remote 0 と同じ設定です
ip nat 1 192.168.2.250/HTTP 202.xx.xx.50 remote 0
    192.168.2.250のHTTP とグローバルIPアドレス 202.xx.xx.50 を関連付けます
    ※192.168.2.250/HTTP と 192.168.2.250/tcp/80 は同じ設定です
ip nat 2 192.168.2.251/FTP 202.xx.xx.51 remote 0
    192.168.2.251のFTP とグローバルIPアドレス 202.xx.xx.51 を関連付けます
    ※192.168.2.251/FTP と 192.168.2.251/tcp/20-21 は同じ設定です
ip nat 3 192.168.2.252/POP3 202.xx.xx.52 remote 0
    192.168.2.252のPOP3 とグローバルIPアドレス 202.xx.xx.52 を関連付けます
    ※192.168.2.252/POP3 と 192.168.2.252/tcp/110 は同じ設定です
ip nat 4 192.168.2.252/SMTP 202.xx.xx.52 remote 0
    192.168.2.252のSMTP とグローバルIPアドレス 202.xx.xx.52 を関連付けます
    ※192.168.2.252/SMTP と 192.168.2.252/tcp/25 は同じ設定です
ip nat 5 192.168.2.253/SSH 202.xx.xx.53 remote 0
    192.168.2.253のSSH とグローバルIPアドレス 202.xx.xx.53 を関連付けます
    ※192.168.2.253/SSH と 192.168.2.253/tcp_udp/22 は同じ設定です
ip nat 6 192.168.2.254/TELNET 202.xx.xx.54 remote 0
    192.168.2.254のTELNET とグローバルIPアドレス 202.xx.xx.54 を関連付けます
    ※192.168.2.254/TELNET と 192.168.2.254/tcp/23 は同じ設定です
ip nat 64 */* 202.xx.xx.49 remote 0
    NAPTを設定します
ip spi mode off
    SPI機能をオフに設定します
ip stealth mode off
    ステルス機能をオフに設定します