cisco · Catalyst 9300 Series Switch · 34 pp.
Cisco Catalyst 9300 Series Switch: Настройка перевода сетевых адресов (NAT) Руководство пользователя
Руководство по настройке и использованию Network Address Translation (NAT) на устройствах Cisco Catalyst 9300 Series Switch.
Related manuals
Contents
Document text
Benefits of Configuring Network Address Translation
Configuring Network Address Translation Information About Network Address Translation, on page 1 Configuring Network Address Translation, on page 13 Configuration Examples for Network Address Translation, on page 31 Troubleshooting NAT, on page 32 Feature History for Network Address Translation, on page 32 Information About Network Address Translation The following sections provide information about Network Address Translation (NAT). Network Address Translation NAT is designed for IP address conservation. It enables private IP networks that use unregistered IP addresses to connect to the Internet.
NAT operates on a device, usually connecting two networks together, and translates the private (not globally unique) addresses in the internal network into global routable addresses, before packets are forwarded onto another network. NAT can be configured to advertise only one address for the entire network to the outside world. This ability provides additional security by effectively hiding the entire internal network behind that one address. NAT offers the dual functions of security and address conservation and is typically implemented in remote-access environments.
NAT is also used at the enterprise edge to allow internal users access to the Internet and to allow Internet access to internal devices such as mail servers. Cisco Catalyst 9300 Series Switch supports Stacking and NAT is supported on a stack set-up. Benefits of Configuring Network Address Translation • Resolves the problem of IP depletion. NAT allows organizations to resolve the problem of IP address depletion when they have existing networks and need to access the Internet.
Sites that do not yet possess Network Information Center (NIC)-registered IP addresses must acquire IP addresses, and if more than 254 clients are present or are planned, the scarcity of Class B addresses becomes a serious issue. NAT addresses these issues by mapping thousands of hidden internal addresses to a range of easy-to-get Class C addresses. Configuring Network Address Translation 1
Uses of Network Address Translation
• Provides a layer of security by preventing the client IP address from being exposed to the outside network. Sites that already have registered IP addresses for clients on an internal network may want to hide those addresses from the Internet so that hackers cannot directly attack clients. With client addresses hidden, a degree of security is established. NAT gives LAN administrators complete freedom to expand Class A addressing, which is drawn from the reserve pool of the Internet Assigned Numbers Authority. The expansion of Class A addresses occurs within the organization without a concern for addressing changes at the LAN or the Internet interface.
• Cisco software can selectively or dynamically perform NAT. This flexibility allows network administrator to use RFC 1918 addresses or registered addresses. • NAT is designed for use on a variety of devices for IP address simplification and conservation. In addition, NAT allows the selection of internal hosts that are available for translation. • A significant advantage of NAT is that it can be configured without requiring any changes to devices other than to those few devices on which NAT will be configured. How Network Address Translation Works A device that is configured with NAT will have at least one interface to the inside network and one to the outside network.
In a typical environment, NAT is configured at the exit device between a stub domain and the backbone. When a packet leaves the domain, NAT translates the locally significant source address into a globally unique address. When a packet enters the domain, NAT translates the globally unique destination address into a local address. Multiple inside networks could be connected to the device and similarly there might exist multiple exit points from the device towards outside networks. If NAT cannot allocate an address because it has run out of addresses, it drops the packet and sends an Internet Control Message Protocol (ICMP) host unreachable packet to the destination.
Translation and forwarding are performed in the hardware switching plane, thereby improving the overall throughput performance. For more details on performance, refer the section on Performance and Scale Numbers for NAT. Figure 1: NAT Uses of Network Address Translation NAT can be used for the following scenarios: • To connect to the Internet when only a few of your hosts have globally unique IP address. Configuring Network Address Translation How Network Address Translation Works Configuring Network Address Translation 2
Network Address Translation Inside and Outside Addresses
NAT is configured on a device at the border of a stub domain (referred to as the inside network) and a public network such as the Internet (referred to as the outside network). NAT translates internal local addresses to globally unique IP addresses before sending packets to the outside network. As a solution to the connectivity problem, NAT is practical only when relatively few hosts in a stub domain communicate outside of the domain at the same time. When this is the case, only a small subset of the IP addresses in the domain must be translated into globally unique IP addresses when outside communication is necessary, and these addresses can be reused • Renumbering:
Instead of changing the internal addresses, which can be a considerable amount of work, you can translate them by using NAT. Network Address Translation Inside and Outside Addresses The term inside in a NAT context refers to networks owned by an organization that must be translated. When NAT is configured, hosts within this network will have addresses in one space (known as the local address space) that will appear to those outside the network as being in another space (known as the global address space). Similarly, the term outside refers to those networks to which the stub network connects, and which are generally not under the control of an organization.
Hosts in outside networks can also be subject to translation, and can thus have local and global addresses. NAT uses the following definitions: • Inside local address—an IP address that is assigned to a host on the inside network. The address is probably not a routable IP address assigned by NIC or service provider. • Inside global address—a global routable IP address (assigned by the NIC or service provider) that represents one or more inside local IP addresses to the outside world. • Outside local address—the IP address of an outside host as it appears to the inside network. Not necessarily a routable IP address, it is allocated from the address space that is routable on the inside.
• Outside global address—the IP address assigned to a host on the outside network by the owner of the host. The address is allocated from a globally routable address or network space. • Inside Source Address Translation—translates an inside local address to inside global address. • Outside Source Address Translation—translates the outside global address to outside local address. • Static Port Translation—translates the IP address and port number of an inside/outside local address to the IP address and port number of the corresponding inside/outside global address.
• Static Translation of a given subnet—translates a specified range of subnets of an inside/outside local address to the corresponding inside/outside global address. • Half Entry—represents a mapping between the local and global address/ports and is maintained in the translation database of NAT module. A half entry may be created statically or dynamically based on the configured NAT rule. • Full Entry/Flow entry—represents a unique flow corresponding to a given session. In addition to the local to global mapping, it also maintains the destination information which fully qualifies the given flow.
A Full entry is always created dynamically and maintained in the translation database of NAT module. Configuring Network Address Translation Network Address Translation Inside and Outside Addresses Configuring Network Address Translation 3
Route Map-based Network Address Translation
You can enable NAT on Layer 3 Multi-chassis EtherChannel (MEC) using the interface port-channel command. Note VRF-Aware Network Address Translation NAT is typically configured to operate across the default or global routing domain. As per this feature, the inside and outside NAT domains are associated with the default VRF space and the translations are effected accordingly. However, there are certain scenarios where NAT is required to operate in a VRF setting. One common scenario involves enabling shared service access for private networks that have overlapping address space.
In such cases, the given private networks can be placed in different VRFs and global service access can be achieved by configuring VRF-aware NAT rules that map overlapping private address to unique global address. VRF-awareness enables NAT to carry out address and port translation by taking the VRF of the private networks into consideration. VRF-aware NAT supports only VRF to Global translation of IP addresses. VRF to Global translation is between a NAT inside interface that is associated with a specific VRF and a NAT outside interface that is associated with the global VRF.
Intra-VRF NAT translation (which involves the NAT-inside and NAT-outside interfaces of the same specific VRF) and Inter-VRF NAT translation (which involves NAT-inside and NAT-outside interfaces that are associated with different VRFs) are not supported. NAT behavior is undefined in such unsupported scenarios. We recommend that you deploy only the VRF to Global NAT translation in your network. Route Map-based Network Address Translation Route maps are similar to access control lists (ACLs) and allow users to define a set of match-criteria with associated actions. Route maps are more versatile and have additional capabilities that can address certain use cases that cannot be handled by ACLs.
Route maps are widely used by various applications such as policy-based routing (PBR) and route-redistribution etc. For more information about route maps, see the “Route Maps to Redistribute Routing Information” section in the Cisco IOS XE IP Routing Configuration Guide . In the context of NAT, route maps are used to carry out destination-based translations, where the same local addresses are translated to different global addresses based on the flow destination. Route map-based static and dynamic translations are supported, and the same route map can be associated with multiple rules as illustrated in the figure below.
Configuring Network Address Translation VRF-Aware Network Address Translation Configuring Network Address Translation 4