| 新規作成日 | 2001/Jun/19 | 最終変更日 | 2018/Nov/06 |
| 文書サイズ | 17KB |
[ 環境/条件 ]
| 項目 | 内容 |
|---|---|
| 接続形態 | 2つのLANをルーティング |
| ルータ | ローカルルータ(RT140e) |
| ルーティング情報 | 使わない/static |
| NAT変換タイプ | IPマスカレード |
| 外側アドレス | 1個か、2個 |
| 内側アドレス | プライベートアドレス |
| DHCP | LAN1側で使用する |
※NATディスクリプタの適用前の基本となる設定
[ NATディスクリプタの適用例 ]
インターネット
|
+--------+--------+
| ゲートウェイ |
+--------+--------+
|133.176.200.1
| 133.176.200.0/24
---------+-------+---------------------------+-------------
| |
|133.176.200.68 |133.176.200.47
+--------+--------+ [ PC ]
| [ LAN 2 ] |
| | |
| [NAT] |←NATやIPマスカレード
| | |
| IPルーティング |
| | |
| [ LAN 1 ] |RT140e
+--------+--------+
|192.168.0.1
| 192.168.0.0/24
---------+-------+---------------------------+-------------
| |
|192.168.0.2 |192.168.0.XXX
[ 公開サーバ ] [ PC ]
|
[ IPアドレスを1個をIPマスカレード + 静的IPマスカレード(サーバ公開) ]
1つのグローバルアドレスをIPマスカレードで共有します。
サービスを公開する場合には、静的IPマスカレードを用いて、
特定のサービスのみ公開します。
| NATディスクリプタ番号 | 1 | |
| タイプ | masquerade | |
| 外側アドレス | 133.176.200.68 (LAN2のアドレス) | |
| 内側アドレス | auto (all,すべて) | |
| 静的NAT設定 | なし | |
| 静的IPマスカレード設定 |
192.168.0.2, tcp, www (http) 192.168.0.2, tcp, https | 公開サービス |
| 適用インタフェース | LAN2 |
<外側> …LAN2インタフェース側
+------------+
| ☆ | …外側アドレス
| ↑ | nat descriptor address outer
| | |
| ▲ | …1組のIPマスカレード変換
| / \ |
| ↑↑↑↑↑ |
| ○○○○○ | …内側アドレス
+------------+ nat descriptor address inner
<内側> …ルーティング側
|
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.68 (または、primary) nat descriptor masquerade static 1 1 192.168.0.2 tcp www,https dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.68 nat descriptor address inner 1 133.176.200.68 192.168.0.1-192.168.0.254 nat descriptor masquerade static 1 1 192.168.0.2 tcp www,https dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
[ IPアドレス1個をIPマスカレード + 1個を静的NAT(サーバ公開) ]
1つのグローバルアドレスをIPマスカレードでクライアント機器で共有します。
公開用サーバには、別のグローバルアドレスを用意し、静的NATで運用し、
すべてのサービスを公開します。
| NATディスクリプタ番号 | 1 | |
| タイプ | masquerade | |
| 外側アドレス | 133.176.200.68 (LAN2のアドレス) | |
| 内側アドレス | auto (all,すべて) または 133.176.200.68 192.168.0.1-192.168.0.254 | |
| 静的NAT設定 | 133.176.200.200=192.168.0.2 | 公開サーバの設定 |
| 静的IPマスカレード設定 | なし | |
| 適用インタフェース | LAN2 |
<外側> …LAN2インタフェース側
+----+------------+
| ★ | ☆ | …外側アドレス
| ↑ | ↑ |
| | | | |
| ■ | ▲ | …1組の静的NATと1組のIPマスカレード
| | | / \ |
| ↑ | ↑↑↑↑↑ |
| ● | ○○○○○ | …内側アドレス
+----+------------+
<内側> …ルーティング側
|
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.68 (または、primary) nat descriptor static 1 1 133.176.200.200=192.168.0.2 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.68 nat descriptor address inner 1 133.176.200.68 192.168.0.1-192.168.0.254 nat descriptor static 1 1 133.176.200.200=192.168.0.2 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
[ IPアドレス1個をIPマスカレード + 1個をIPマスカレード(サーバ公開) ]
1つのグローバルアドレスをIPマスカレードでクライアント機器で共有します。
公開用サーバには、別のグローバルアドレスを用意しますが、IPマスカレード
で運用します。公開するサービスは、静的IPマスカレードで公開します。
| NATディスクリプタ番号 | 1 | 公開サーバ用設定 |
| タイプ | masquerade | |
| 外側アドレス | 133.176.200.200 | グローバルアドレス |
| 内側アドレス | 192.168.0.2 | プライベートアドレス |
| 静的IPマスカレード設定 |
192.168.0.2, tcp, www (http) 192.168.0.2, tcp, https | 公開サービス |
| 適用インタフェース | LAN2 | NATディスクリプタ2より先に適用する |
| NATディスクリプタ番号 | 2 | クライアント用設定 |
| タイプ | masquerade | |
| 外側アドレス | 133.176.200.68 (LAN2のアドレス) | |
| 内側アドレス | auto (all,すべて) または 133.176.200.68 192.168.0.1-192.168.0.254 | |
| 静的IPマスカレード設定 | なし | |
| 適用インタフェース | LAN2 |
<外側> …LAN2インタフェース側
+------------++------------+
| ★ || ☆ | …外側アドレス
| ↑ || ↑ |
| | || | |
| ▲ || ▲ | …2組のIPマスカレード
| / \ || / \ |
| ↑↑↑↑↑ || ↑↑↑↑↑ |
| ● || ○○○○○ | …内側アドレス
+------------++------------+
<内側> …ルーティング側
|
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 2 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.200 nat descriptor address inner 1 192.168.0.2 nat descriptor masquerade static 1 1 192.168.0.2 tcp www,https nat descriptor type 2 masquerade nat descriptor address outer 2 133.176.200.68 (または、primary) dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 nat descriptor 1 2 nat descriptor type 1 masquerade nat descriptor address outer 1 133.176.200.200 nat descriptor address inner 1 192.168.0.2 nat descriptor masquerade static 1 1 192.168.0.2 tcp www,https nat descriptor type 2 masquerade nat descriptor address outer 2 133.176.200.68 nat descriptor address inner 2 133.176.200.68 192.168.0.1-192.168.0.254 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
[ ローカルルータとして使用する設定 ]
インターネット
|
+--------+--------+
| ゲートウェイ |
+--------+--------+
|133.176.200.1
| 133.176.200.0/24
---------+-------+---------------------------+-------------
| |
|133.176.200.68 |133.176.200.47
+--------+--------+ [ PC ]
| [ LAN 2 ] |
| | |
| IPルーティング |
| | |
| [ LAN 1 ] |RT140e
+--------+--------+
|192.168.0.1
| 192.168.0.0/24
-----------------+---------------------------+-------------
|
|192.168.0.XXX
[ PC ]
|
|
ip lan1 address 192.168.0.1/24 ip lan2 address 133.176.200.68/24 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
|
ip lan1 address 192.168.0.1/24 ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
|
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
|
ip lan1 address 192.168.0.1/24 ip lan1 routing protocol none< ip lan2 address 133.176.200.68/24 ip lan2 routing protocol none ip lan2 route add net default 133.176.200.1 1 dhcp service server dhcp scope 1 192.168.0.2-192.168.0.254/24 |
|
|