Configuring IP Addressing

Configuring Network Address Translation

Figure 5 NAT Overloading Inside Global Addresses

Inside

5

1.1.1.2DA

1.1.1.1

SA

1.1.1.1

1

1.1.1.1

3

SA

2.2.2.2

Internet

4

DA 2.2.2.2

Host B

9.6.7.3

4

DA

S4791

2.2.2.2

 

2NAT table

Protocol

Inside Local IP

Inside Global IP

Outside Global

 

address:port

address:port

IP address:port

 

 

 

 

TCP

1.1.1.2:1723

2.2.2.2:1723

6.5.4.7:23

TCP

1.1.1.1:1024

2.2.2.2:1024

9.6.7.3:23

 

 

 

 

Host C 6.5.4.7

The router performs the following process in overloading inside global addresses, as shown in Figure 5. Both host B and host C believe they are communicating with a single host at address 2.2.2.2. They are actually communicating with different hosts; the port number is the differentiator. In fact, many inside hosts could share the inside global IP address by using many port numbers.

1.The user at host 1.1.1.1 opens a connection to host B.

2.The first packet that the router receives from host 1.1.1.1 causes the router to check its NAT table:

If no translation entry exists, the router determines that address 1.1.1.1 must be translated, and sets up a translation of inside local address 1.1.1.1 to a legal global address.

If overloading is enabled, and another translation is active, the router reuses the global address from that translation and saves enough information to be able to translate back. This type of entry is called an extended entry.

3.The router replaces the inside local source address 1.1.1.1 with the selected global address and forwards the packet.

4.Host B receives the packet and responds to host 1.1.1.1 by using the inside global IP address 2.2.2.2.

5.When the router receives the packet with the inside global IP address, it performs a NAT table lookup, using the protocol, inside global address and port, and outside address and port as a key; translates the address to inside local address 1.1.1.1; and forwards the packet to host 1.1.1.1.

Host 1.1.1.1 receives the packet and continues the conversation. The router performs Steps 2 through 5 for each packet.

To configure overloading of inside global addresses, use the following commands in global configuration mode:

 

Command

 

 

 

Purpose

Step 1

 

 

 

 

 

Router(config)# ip

nat pool

name

start-ip end-ip

Defines a pool of global addresses to be allocated as

 

{netmask netmask

prefix-length

prefix-length}

needed.

Step 2

 

 

 

Router(config)# access-list

access-list-number

Defines a standard access list.

 

permit source [source-wildcard]

 

 

 

 

 

 

 

 

Cisco IOS IP Configuration Guide

IPC-40

Page 86
Image 86
Cisco Systems 78-11741-02 manual Defines a standard access list, IPC-40