CISCO NAT 変換について

CISCO スタティック NAT 変換

スタティックNAT変換の設定順序

■ネットワーク図

LocalNetwork -- e0 | Router | s0 -- The Internet

■インタフェース設定

e0:10.1.1.1
s0:100.100.100.1

■コマンド

(config)#ip nat inside source static 10.1.1.1 100.100.100.1
(config)#int e0
(config-if)#ip nat inside
(config-if)#int s0
(config-if)#ip nat outside

CISCO ダイナミック NAT 変換

ダイナミック NAT 変換の設定順序

  1. グローバルIPアドレスプールの定義
  2. 標準ACLの定義
  3. ACLをアドレスプールに指定
  4. インタフェースの設定

■ネットワーク図

LocalNetwork -- e0| Router |s0 -- The Internet

■インタフェース設定

e0側ネットワーク:10.1.1.0/24
s0側ネットワーク:100.100.100.0/24

■アドレスプール

プール名:nat-pool
プール範囲:100.100.100.1-100.100.100.5

■コマンド

(config)#ip nat pool nat-pool 100.100.100.1 100.100.100.5 netmask 255.255.255.0
(config)#access-list 1 permit 10.1.1.0 0.0.0.255
(config)#ip nat inside source list 1 pool nat-pool
(config)#int e0
(config-if)#ip nat inside
(config-if)#int s0
(config-if)#ip nat outside

オーバーロード変換

オーバーロード変換とは

●ダイナミックNAT変換の一つで、ポート番号を使用して複数のノードで一つのグローバルIPを共有する技術。

IPマスカレードの事。CISCO では PAT という。

●基本的な設定はダイナミックNATと同じだが、ACL とプールのマッピングに"overload"の引数を指定する。

(例:ip nat inside source list ACL番号 pool プール名 overload ) ※ポート番号の指定はしないことに注意。

オーバーロード変換の設定順序

■ネットワーク図

LocalNetwork -- e0 | Router | s0 -- The Internet

■インタフェース設定

e0側ネットワーク:10.1.1.0/24
s0:100.100.100.1/24

■ポート番号例

10.1.1.10:1025⇒100.100.100.1:1025
10.1.1.11:1027⇒100.100.100.1:1027
10.1.1.12:1030⇒100.100.100.1:1030

■アドレスプール

プール名:pat-pool
プールアドレス:100.100.100.1

■コマンド

(config)#ip nat pool pat-pool 100.100.100.1 100.100.100.1 netmask 255.255.255.0
(config)#access-list 1 permit 10.1.1.0 0.0.0.255
(config)#ip nat inside source list 1 pool pat-pool overload
(config)#int e0
(config-if)#ip nat inside
(config-if)#int s0
(config-if)#ip nat outside

CISCO PNAT Configuration (example)
! ---- CISCO PNAT Configuration example
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname RouterA
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
ip subnet-zero
!
!
!
!
interface Ethernet0
 ip address 192.168.0.11 255.255.255.0
 ip nat outside
!
interface Ethernet1
 ip address 192.168.1.254 255.255.255.0
 ip nat inside
!
interface Serial0
 no ip address
 shutdown
!
interface Serial1
 no ip address
 shutdown
!
ip nat inside source list 1 interface Ethernet0 overload
ip http server
ip classless
ip route 0.0.0.0 0.0.0.0 192.168.0.10
!
!
access-list 1 permit 192.168.1.0 0.0.0.255
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end
created:

Back to top