Header
Home | Set as homepage | Add to favorites
  Search the Site     » Advanced Search
Sections
Syndication


Blogroll:

||||| ALL Cisco-Network ARTICLES |||||  
CCIE Journey,
The CCIE Journey,


Network Address Translation

Feb 03,2010 by alperen

image

Network Address Translation

While static address mappings allow permanent outside access to inside resources like servers, users also require address translation to venture into less secure networks, such as the outside. To reduce the window of vulnerability that permanent static mappings introduce, users generally use the nat/global command combination to create temporary mappings while they’re in the less-secure area. These mappings are removed after the session ends.

NAT syntax and operation were covered in Chapter 17. This section concentrates on those options and implications that might not have been covered earlier. The nat and global commands are always used together, the nat command defining the local host(s) that can be translated to travel to less-secure networks. The global command identifies the pool of “real” global IP addresses that can provide access to the less-secure network. The nat_id identifies the pool of global addresses that can be accessed by the nat command. The two basic command syntaxes are

Pix(config)# global (if_name) nat_id {global_ip [-global_ip] [netmask global_mask] | interface}
Pix(config)# nat (if_name) nat_id local_ip [netmask]

The following example creates a global address\pool, nat_id = 1, that contains all the class C network 215.1.2.0, plus the 31 host addresses included in 1.1.1.1-1.1.1.30. The nat command allows all hosts on the 192.168.1.0 inside network to start outbound connections.

Pix(config)# global (outside) 1 215.1.2.0
Pix(config)# global (outside) 1 1.1.1.1-1.1.1.30 netmask 255.255.255.224
Pix(config)# nat (inside) 1 192.168.1.0 255.255.255.0

Remember the following about global/nat address mappings:

  • After changing or removing a nat command statement, use the clear xlate command.

  • You can define up to 256 global pools of addresses.

  • Never use an address in a global address pool for static mapping.

  • Static mappings always take precedence over mappings created using the nat command.

An All Hosts Option

The next examples show a handy shorthand to allow all inside hosts to use NAT to create outbound connections. The 0 0 is a short notation for the local_ip /netmask combination 0.0.0.0 0.0.0.0.

Pix(config)# nat (inside) 1 0 0

Additional NAT Options

The nat command lets you enable or disable address translation for one or more internal addresses. Some of the options available, such as norandomseq, conn_limit, and em_limit, are the same as covered in the static command section. To enable NAT for an address or group of addresses, use the following syntax. Use the no command to turn off the feature.

Pix(config)# nat (if_name) nat_id ip_address [netmask] [outside] [dns] [norandomseq]
[timeout hh:mm:ss] [conn_limit] [em_limit]
Pix(config)# no nat (if_name) nat_id address [netmask] [outside]

To disable NAT for an address or group of addresses, use the following syntax. Use the no command to turn off the feature.

Pix(config)# nat (if_name) 0 access-list acl_name
Pix(config)# no nat (if_name) 0 [access-list acl_name]

nat_id

Values can be 0, 0 access-list acl_name, or a number greater than zero. See the following explanation of the choices.

outside

Enable or disable address translation for the external addresses. Introduced in v6.2 to support access control, IPSec, and AAA that use the real outside address.

dns

Any DNS replies that match the xlate are translated.

timeout hh:mm:ss

Sets an idle timer for the translation slot.

access-list acl_name

Used with the nat 0 command to exempt traffic that matches the access list from NAT processing.

NAT_ID Options

The nat_id option in the nat command can have serious implications for how the NAT process works. The next paragraphs offer an explanation and examples of each choice.

NAT 0

The nat 0 turns off NAT translation for the defined address(es). The result is called identity translation, which is a translation that maps an address to itself. This command assumes the host address is a valid global address that can be used out in the Internet.

At first glance, this seems like the Static Command option of using the current IP address for both addresses. The difference between this command and the Static option is that this option requires that any resulting traffic must be initiated from an inside host, while the Static Command option allows outside hosts to precipitate access to inside resources. So, if you want the addresses to be visible to the outside, use the static command.

In the following example, the first entry shows an identity translation using the nat 0 command, while the second uses the more public static command.

Pix(config)# nat (dmz) 0 1.1.1.15
Pix(config)# static (dmz, outside) 1.1.1.15 1.1.1.15

The next examples show the same commands using a class C size group of hosts. The first would be used to allow a group of user hosts with valid global IP addresses to travel the Internet without translation. The second would be used to make a large pool of shared servers available to the outside world, assuming appropriate ACLs are created.

Pix(config)# nat (dmz) 0 1.1.2.0 255.255.255.0
Pix(config)# static (dmz, outside) 1.1.2.0 1.1.2.0 netmask 255.255.255.0

NAT_ID Greater Than 0

This is normal NAT with the nat_id greater than zero (0), indicating a pool of global IP addresses specified by the global command. The same nat_id in a nat command and global command links the two together.

The following example demonstrates using the global command to create a global address pool (9) with 508 addresses. The nat command allows the hosts on LAN network 192.168.1.0 to access that pool. The net_id, which is 9 in all three commands, links them together.

Pix(config)# global (outside) 9 1.1.2.1-1.1.2.254
Pix(config)# global (outside) 9 1.1.3.0 netmask 255.255.255.0
Pix(config)# nat (inside) 9 192.168.1.0 255.255.255.0

No Network or Broadcast IDs Allowed

ASA won’t allow network or broadcast IDs to be included in the xlate table entries. If the Netmask global_mask option is used with a network ID to define a pool of addresses, the PIX automatically excludes the host ID and broadcast addresses from the pool available for translations.

ASA specifies a subnet mask, for example, 255.255.255.128 specifies one half of a class C network. If a specified address range in the global_ip-global_ip overlaps subnets defined by the netmask global_mask statement, the global pool won’t use any broadcast or network addresses included in the pool of global addresses. In the following global command, the pool is the first 16 addresses on the 10.1.1.0 network (10.1.1.0-15).

Pix(config)# global (outside) 1 10.1.1.0 netmask 255.255.255.240
Pix(config)# nat (inside) 1 192.168.1.0 255.255.255.0

Because 10.1.1.0 is the network and 10.1.1.15 is the broadcast address for the network, they’ll be excluded from the actual pool, leaving 10.1.1.1 to 10.1.1.14. Another way this could be defined is the following:

Pix(config)# global (outside) 1 10.1.1.1-10.1.1.14
Pix(config)# nat (inside) 1 192.168.1.0 255.255.255.0

958 times read

Related news

» Using NAT and PAT Together
by alperen posted on Feb 03,2010
» Port Address Translations (PAT)
by alperen posted on Feb 03,2010
» Configuring Dynamic NAT
by alperen posted on Nov 27,2008
» Configuring NAT for Overlapping Addresses
by alperen posted on Nov 27,2008
» Allocating External Addresses Dynamically
by admin posted on Jul 21,2008
Did you enjoy this article?
(total 0 votes)

comment Comments (0 posted) 

More Top News
CCSP-Cisco Certified Security Professional
Most Popular
Most Commented
Featured Author