Nat - 6
Nat - 6
Firewall 1/2
Network Address Translation (NAT)
Overview
Security Considerations
Public/official/legal address versus Private address
RFC 1918
12 bits in common
10101100 . 00010000 . 00000000 . 00000000 – 172.16.0.0
10101100 . 00011111 . 11111111 . 11111111 – 172.31.255.255
-------------------------------------------------------------
10101100 . 00010000 . 00000000 . 00000000 – 172.16.0.0/12
Because private addresses have no global meaning,
routing information about private networks shall
not be propagated on inter-enterprise links, and
packets with private source or destination
addresses should not be forwarded across such
links. Routers in networks not using private
address space, especially those of Internet service
providers, are expected to be configured to reject
(filter out) routing information about private
networks. If such a router receives such
information the rejection shall not be treated as a
routing protocol error.
NAT concepts
NAT Terminology "Inside Addressing"
•Inside local; Configured IP address assigned to a
host on the inside network. Address may be globally
unique, allocated out of the private address space
defined in RFC 1918, or might be officially allocated
to another organization.
DA SA DA SA
IP Header IP Header
1 2
• The translation from Private source IP address to Public source IP address.
NAT Example
4 3
DA SA DA SA
4 IP Header 3 IP Header
• Inside local address – The IP address assigned to a host on the inside network. This
address is likely to be an RFC 1918 private address.
• Inside global address – A legitimate (Internet routable or public) IP address assigned the
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 is known to the hosts on
the inside network.
• NAT is designed to conserve IP addresses and enable networks to use private IP addresses
on internal networks.
• These private, internal addresses are translated to routable, public addresses.
• NAT, as defined by RFC 1631, is the process of swapping one address for another in the IP
packet header.
• In practice, NAT is used to allow hosts that are privately addressed to access the Internet.
• NAT translations can occur dynamically or statically.
• The most powerful feature of NAT routers is their capability to use port address translation
(PAT), which allows multiple inside addresses to map to the same global address.
• This is sometimes called a many-to-one NAT.
Main Features
Match Host
The ability to configure NAT to assign the same Host portion of an
IP Address and only translate the Network prefix portion of the
IP Address. Useful where you are using the host portion as a
means to identify or number users uniquely
Configuring Dynamic NAT
The network address space you
have received from your ISP is
In ISP’s routing table:
179.9.8.0/24.
179.9.8.0/24 via 192.168.1.1
ISP
Translate to these
outside addresses
Start
here
Source IP address
must match here
0.0.255.255
Main Features
•NAT allows you to have more than your allocated number of IP
addresses by using RFC 1918 address space with smaller mask.
•However, because you have to use your Public IP addresses for
the Internet, NAT still limits the number of hosts you can have
access the Internet at any one time (depending upon the number
of hosts in your public network mask.)
• PAT (Port Address Translation) allows you to use a single Public IP address and assign it up to
65,536 inside hosts (4,000 is more realistic).
• PAT modifies the TCP/UDP source port to track inside Host addresses.
• Tracks and translates SA, DA and SP (which uniquely identifies each connection) for each stream
of traffic.
PAT Example
NAT/PAT table
maintains translation
of:
DA, SA, SP
DA SA DP SP DA SA DP SP
DA SA DP SP DA SA DP SP
DA SA DP SP DA SA DP SP
DA SA DP SP DA SA DP SP
• As long as the inside global port numbers are unique for each inside
local host, NAT overload will work. For example, if the host at
10.1.1.5 and 10.1.1.6 both use TCP port 1234, the NAT router can
create the extended table entries mapping 10.1.1.5:1234 to
171.70.2.2:1234 and 10.1.1.6:1234 to 171.70.2.2:1235.
Destination Address Rotary Translation
A dynamic form of destination translation can be
configured for some outside-to-inside traffic. Once a
mapping is set up, a destination address matching one of
those on an access list will be replaced with an address
from a rotary pool. Allocation is done in a round-robin
basis, performed only when a new connection is opened
from the outside to the inside. This feature was designed to
provide protocol translation load distribution. It is not
designed to be used as a substitute technology for Cisco's
LocalDirector product. If a Web server were to become
offline, the destination address rotary translation feature
would continue to send requests to the downed server.
Cisco Configuration Commands
Exam example …
Configuration Example 3
10.1.0.0
• In this example a single Public IP addresses is used, using PAT, source ports, to
differentiate between connection streams.
Configure PAT – Overload
This is a different
example, using the IP
address of the outside
interface instead
specifying an IP
address
Showing active translations
show ip nat translations
Debugging
debug ip nat [ <list> ] [ detailed ]
NAT/PAT Clear Commands
Sometimes you receive these messages when you
change the Network Address Translation (NAT)
configuration:
Dynamic mapping in use, cannot remove
%Pool outpool in use, cannot destroy
TFTP
telnet, …
Issues with NAT/PAT
• NAT also forces some applications that use IP addressing to stop functioning because it
hides end-to-end IP addresses.
• Applications that use physical addresses instead of a qualified domain name will not
reach destinations that are translated across the NAT router.
• Sometimes, this problem can be avoided by implementing static NAT mappings.
• Furthermore, many application protocols carry IP
addresses in an application-level protocol . In such
cases, an Application-Level Gateway (ALG) is
needed to complete the translation. For example:
NAT-PT for Cisco IOS software was designed using RFC 2766
and RFC 2765 as a migration tool to help customers transition
their IPv4 networks to IPv6 networks. Using a protocol
translator between IPv6 and IPv4 allows direct communication
between hosts speaking a different network protocol.
Static NAT-PT Operation
Static NAT-PT uses static translation rules to map one IPv6 address
to one IPv4 address. IPv6 network nodes communicate with IPv4
network nodes using an IPv6 mapping of the IPv4 address
configured on the NAT-PT router.
The NAT-PT device is configured to map the source IPv6 address
for node A of 2001:0db8:bbbb:1::1 to the IPv4 address
192.168.99.2.
NAT-PT is also configured to map the source address of IPv4 node
C, 192.168.30.1 to 2001:0db8::a. When packets with a source IPv6
address of node A are received at the NAT-PT router they are
translated to have a destination address to match node C in the IPv4-
only network.
NAT-PT can also be configured to match a source IPv4 address and
translate the packet to an IPv6 destination address to allow an IPv4-
only host communicate with an IPv6-only host.
If you have multiple IPv6-only or IPv4-only hosts that need to
communicate, you may need to configure many static NAT-PT
mappings. Static NAT-PT is useful when applications or
servers require access to a stable IPv4 address.