Support - Technologie WAN (Lecture 2) (1)
Support - Technologie WAN (Lecture 2) (1)
Filière RST – S7
Pr Chaïmaâ KISSI
IPv4 Switching & Routing
ACL Operation
• Purpose and operation of ACLs in small to medium-sized business networks :
- How ACLs filter traffic ?
- How ACLs use wildcard masks ?
- How to create ACLs ?
- How to place ACLs ?
Standard IPv4 ACLs
• Configure standard IPv4 ACLs to filter traffic in a small to medium-sized business network :
- Configure standard IPv4 ACLs to filter traffic to meet networking requirements
- Use sequence numbers to edit existing standard IPv4 ACLs
- Configure a standard ACL to secure VTY access
Troubleshoot ACLs
• How a router processes packets when an ACL is applied ?
• Troubleshoot common standard IPv4 ACL errors using CLI commands
IPv4 Switching & Routing
What is an ACL?
• An ACL is a series of IOS commands that control whether a router forwards or drops packets based on information found in
the packet header.
ACLs are not configured by default on a router.
ACL performing tasks
• Limit network traffic to increase network performance.
For example, video traffic could be blocked if it's not permitted.
• Provide traffic flow control.
ACLs can help verify routing updates are from a known source.
• ACLs provide security for network access and can block a host or a network.
• Filter traffic based on traffic type such as Telnet traffic.
• Screen hosts to permit or deny access to network services such as FTP or HTTP.
IPv4 Switching & Routing
Packet Filtering
• An ACL is a sequential list of permit or deny statements, known as access control entries (ACEs).
ACEs are commonly called ACL statements
Definition
• When network traffic passes through an interface configured with an ACL, the router compares the information within the
packet against each ACE, in sequential order, to determine if the packet matches one of the ACEs.
• This is referred to as packet filtering.
Tasks
Packet Filtering :
- Can analyze incoming and/or outgoing packets.
- Can occur at Layer 3 or Layer 4.
Important remark !!!
• The last statement of an ACL is always an implicit deny.
• This is automatically inserted at the end of each ACL and blocks
all traffic. Because of this, all ACLs should have at least one permit
statement.
IPv4 Switching & Routing
Inbound vs Outbound ACL
• ACLs define the set of rules that give added control for packets that enter inbound interfaces, packets that relay through the
router, and packets that exit outbound interfaces of the router.
• ACLs can be configured to apply to inbound traffic and outbound traffic :
- Inbound ACLs : Incoming packets are processed before they are routed to the outbound interface.
- Outbound ACLs : Incoming packets are routed to the outbound interface, and then they are processed through the
outbound ACL.
IPv4 Switching & Routing
ACL Wildcard Masking
• IPv4 ACLs require the use of wildcard masks.
Definition
• A wildcard mask is a string of 32 binary digits (1s and 0s) used by the router to determine which bits of the address to
examine for a match.
• Wildcard masks are often referred to as an inverse mask since unlike a subnet mask where a binary 1 is a match, a binary 0 is
a match with wildcard masks.
Examples
• Example of Wildcard Masks to Match IPv4 Hosts & Subnets is treated in this section. The aim is to calculate the wildcard
mask to match IPV4 subnets takes practice.
Example 1 : The wildcard mask stipulates that every bit in the IPv4 192.168.1.1 address must match exactly.
=> Example 3: The wildcard mask stipulates that any host within the 192.168.1.0/24 network will match.
Calculating the Wildcard Mask
• Example 1
- Assume you want to permit access to all users in the 192.168.3.0 network with the subnet mask of 255.255.255.0.
- Subtract the subnet from 255.255.255.255 and the result is : 0.0.0.255.
• Example 2
- Assume you want to permit network access for the 14 users in the subnet 192.168.3.32/28 with the subnet mask of
255.255.255.240.
- After subtracting the subnet maks from 255.255.255.255, the result is 0.0.0.15.
• Example 3
- Assume you want to match only networks 192.168.10.0 and 192.168.11.0 with the subnet mask of 255.255.254.0.
- After subtracting the subnet mask from 255.255.255.255, the result is 0.0.1.255.
Wildcard Mask Keywords
• To make wildcard masks easier to read, the keywords host and any can help identify the most common uses of wildcard
masking.
• host substitutes for the 0.0.0.0 mask
• any substitutes for the 255.255.255.255 mask
Easy Tips !!!!
• If you would like to match the 192.169.10.10 address :
- you could use 192.168.10.10 0.0.0.0 or,
- you can use: host 192.168.10.10
• In Example 2, instead of entering 0.0.0.0 255.255.255.255 -> you can use the keyword any by itself.
Example of Wildcard Mask Keywords
• The figure demonstrates how to use the any keyword to substitute the IPv4 address 0.0.0.0 with a wildcard mask of
255.255.255.255.
• The figure shows how to use the host keyword to substitute for the wildcard mask when identifying a single host.
Guidelines for Creating ACLs
• The general guidelines for creating ACLs are summarized in the following steps :
- Use ACLs in firewall routers positioned between your internal network and an external network such as the Internet.
- Use ACLs on a router positioned between two parts of your network to control traffic entering or exiting a specific part of
your internal network.
- Configure ACLs on border routers such as those situated at the edge of your network. This will provide a basic buffer from
the outside network that is less controlled.
- Configure ACLs for each network protocol configured on the border router interfaces.
ACL traffic filtering on a Router
• The output of the show access-list command shows the one deny statement in the ACL.
• The set of commands listed below shows the solution
The permit statement allows other devices to access since the implicit deny was blocking other traffic.
Common IPv4 Standard ACL Errors
Example 2
• The 192.168.11.0/24 network should not be able to access the 192.168.10.0/24 network.
• PC2 cannot access PC1 as planned, however, it also cannot access the Internet through R2.
• Problem :/ :/ :/ access-list 20 was applied to G0/1 on an inbound direction
Question => Where should ACL 20 be applied and in which direction?
Answer => In order for PC2 to access the Internet, ACL 20 needs to be removed from the G0/1 interface and applied outbound
on the G0/0 interface.
Common IPv4 Standard ACL Errors
Example 3
• Scenario => Only PC1 should be allowed to SSH to R1.
• Problem => There is a problem with the config in the figure
since PC1 is unable to SSH to R1.
Remark :
- The ACL is still used to define the inside local address
block.
• Each standard numbered ACL has one or more access-list commands with the same number, any number from
the ranges shown in the preceding line of syntax.
• IOS refers to each line in an ACL as an Access Control Entry (ACE), but many engineers just call them ACL
statements.
QUE PASA NEXT ????
• Besides the ACL number, each access-list command also lists the action (permit or deny), plus the matching logic.
• The rest of this section examines how to configure the matching parameters, which, for standard ACLs, means
that you can only match the source IP address or portions of the source IP address using something called an ACL
wildcard mask.
Matching the Exact IP Address
• To match a specific source IP address, the entire IP address, all you have to do is type that IP address at the end of
the command.
• Note that in later IOS versions, if you use the host keyword, IOS accepts the command but then removes the
keyword.
Matching a Subset of the Address with Wildcards
Context and reasons :
• Often , the business goals you want to implement with an ACL do not match a single particular IP address, but
rather a range of IP addresses.
• Maybe you want to match all IP addresses in a subnet.
• Maybe you want to match all IP addresses in a range of subnets.
• Regardless, you want to check for more than one IP address in a range of addresses.
Solution !!!!
• IOS allows standard ACLs to match a range of addresses using a tool called a wildcard mask.
• Note that this is not a subnet mask.
• The wildcard mask (which abbreviates as WC mask) gives the engineer a way to tell IOS to ignore parts of the
address when making comparisons, essentially treating those parts as wildcards, as if they already matched.
Logical processing idea :
• You can think about WC masks in decimal and in binary, and both have their uses.
• To begin, think about WC masks in decimal, using these rules :
- Decimal 0: The router must compare this octet as normal.
- Decimal 255: The router ignores this octet, considering it to already match.
Matching a Subset of the Address with Wildcards
• Keeping these two rules in mind, consider Figure 2-6, which demonstrates this logic using 3 different but popular
WC masks :
- one that tells the router to ignore the last octet,
- one that tells the router to ignore the last 2 octets,
- and one that tells the router to ignore the last 3 octets.
Figure interpretation :
• The example on the left shows WC mask 0.0.0.255, which tells the router to treat the last octet as a wildcard,
essentially ignoring that octet for the comparison.
• Similarly, the middle example shows WC mask 0.0.255.255, which tells the router to ignore the 2 octets on the
right.
• The rightmost case shows WC mask 0.255.255.255, telling the router to ignore the last three octets when
comparing values.
Matching a Subset of the Address with Wildcards
Example interpretation :
• Figure 2-7 shows the updated version of Figure 2-4,
but with the completed, correct syntax, including the
WC masks.
• In particular, note the use of WC mask 0.0.0.255 in
the second command, telling R2 to ignore the last octet of the number 10.1.1.0, and the WC mask 0.255.255.255 in
the third command, telling R2 to ignore the last three octets in the value 10.0.0.0.
Finding the Right Wildcard Mask to Match a Subnet
• In many cases, an ACL needs to match all hosts in a particular subnet.
• To match a subnet with an ACL, you can use the following shortcut :
- Use the subnet number as the source value in the access-list command.
- Use a wildcard mask found by subtracting the subnet mask from 255.255.255.255.
• For example, for subnet 172.16.8.0 255.255.252.0, use the subnet number (172.16.8.0) as the address parameter,
and then do the following math to find the wildcard mask :
Matching Any/All Addresses
• In some cases, you will want one ACL command to match any and all packets that reach that point in the ACL.
• For example, to permit all packets :
Implementing Standard IP ACLs
• The command is :
Process to follow :
Standard Numbered ACL Examples
Example 1
• The first example shows the configuration for the same requirements demonstrated with Figure 2-4 and Figure 2-
5.
• Restated, the requirements for this ACL are as follows :
• Example 2-1 shows a completed correct configuration, starting with the configuration process, followed by
output from the show running-config command.
Standard Numbered ACL Examples
Example 1 (suite)
• Example 2-2 lists some output from Router R2 that shows information about this ACL.
• The show ip access-lists command lists details about IPv4 ACLs only, while the show access lists command lists
details about IPv4 ACLs plus any other types of ACLs that are currently configured; for example, IPv6 ACLs .
Command interpretation :
• The first line of output in this case notes the type (standard)
and the number.
• If more than one ACL existed, you would see multiple stanzas of
output, one per ACL, each with a heading line like this one.
• Next, these commands list packet counts for the number of
packets that the router has matched with each command.
• For example, 107 packets so far have matched the first line in
the ACL.
Example 2
o Scenario :
• For the second example, use Figure 2-8, and imagine your boss gives you some requirements hurriedly in the hall.
• At first, he tells you he wants to filter packets going from the servers on the right toward the clients on the left.
• Then, he says he wants you to allow access for hosts A, B, and other hosts in their same subnet to server S1, but
deny access to that server to the hosts in host C’s subnet.
• Then, he tells you that, additionally, hosts in host A’s subnet should be denied access to server S2, but hosts in
host C’s subnet should be allowed access to server S2—all by filtering packets going right to left only.
• He then tells you to put the ACL inbound on R2’s F0/0 interface.
o Answer :
o Issue :
• As it turns out, you cannot do everything your boss asked with a standard ACL.
• For example, consider the obvious command for requirement number 2: access-list 2 permit 10.2.2.1.
• That permits all traffic whose source IP is 10.2.2.1 (server S1).
• The very next requirement asks you to filter (deny) packets sourced from that same IP address!
• Even if you added another command that checked for source IP address 10.2.2.1, the router would never get to it,
because routers use first-match logic when searching the ACL.
• You cannot check both the destination and source IP address, because standard ACLs cannot check the
destination IP address.
o Solution :
• To solve this problem, you should get a new boss!
• No, seriously, you have to rethink the problem and
change the rules.
• In real life, you would probably use an extended ACL
instead, which lets you check both the source and destination IP address.
Tips :
• For the sake of practicing another standard ACL,
imagine your boss lets you change the requirements.
• First, you will use two outbound ACLs, both on Router
R1.
• Each ACL will permit traffic from a single server to be
forwarded onto that connected LAN, with the following
modified requirements :
o Interpretation details :
• As highlighted in the example, the solution with ACL number 2 permits all traffic from server S1, with that logic
enabled for packets exiting R1’s F0/0 interface.
• All other traffic will be discarded because of the implied deny all at the end of the ACL.
• In addition, ACL3 permits traffic from server S2, which is then permitted to exit R1’s F0/1 interface.
• Also, note that the solution shows the use of the access-list remark parameter, which allows you to leave text
documentation that stays with the ACL.
Troubleshooting and Verification Tips
• Troubleshooting IPv4 ACLs requires some attention to detail.
• In particular, you have to be ready to look at the address and wildcard mask and confidently predict the addresses
matched by those two combined parameters.
• First, you can tell if the router is matching packets or not with a couple of tools.
Example :
• Example2-2 already showed that IOS keeps statistics about the packets matched by each line of an ACL.
• In addition, if you add the log keyword to the end of an access-list command, IOS then issues log messages with
occasional statistics about matches of that particular line of the ACL.
• Both the statistics and the log messages can be helpful in deciding which line in the ACL is being matched by a
packet.
• Example 2-4 shows an updated version of ACL 2 from Example 2-3, this time with the log keyword added.
• The bottom of the example then shows a typical log message, this one showing the resulting match based on a
packet with source IP address 10.2.2.1 (as matched with the ACL), to destination address 10.1.1.1 .
MUY IMPORTANTE !!!!!!!
• When you troubleshoot an ACL for the first
time, before getting into the details of the
matching logic, take the time to think about
both the interface on which the ACL is
Enabled and the direction of packet flow.
Sometimes, the matching logic is perfect—
but the ACL has been enabled on the wrong interface, or for the wrong direction, to match the packets as
configured for the ACL.
Example :
• Figure 2-9 repeats the same ACL shown earlier in Figure 2-7.
• The first line of that ACL matches the specific host address 10.1.1.1. If that ACL exists on Router R2, placing that
ACL as an inbound ACL on R2’s S0/0/1 interface can work, because packets sent by host 10.1.1.1—on the left side
of the figure—can enter R2’s S0/0/1 interface.
However, if R2 enables ACL 1 on its F0/0 interface, for inbound packets, the ACL will never match a packet with
source IP address 10.1.1.1, because packets sent by host 10.1.1.1 will never enter that interface.
Packets sent by 10.1.1.1 will exit R2’s F0/0 interface, but never enter it, just because of the network topology.
Extended Numbered IPv4 ACLs
Standard vs Extended
• Extended IP access lists have many similarities compared to the standard numbered IP ACLs discussed in the
previous chapter.
• Extended ACLs differ from standard ACLs mostly because of the larger variety of packet header fields that can be
used to match a packet.
• One extended ACE (ACL statement) can examine multiple parts of the packet headers, requiring that all the
parameters be matched correctly to match that one ACE.
Matching the Protocol, Source IP, and Destination IP
• Like standard numbered IP ACLs, extended numbered IP ACLs also use the access-list global command.
• The syntax is identical, at least up through the permit or deny keyword.
• In particular, the extended ACL access-list command requires three matching parameters:
- the IP protocol type,
- the source IP address,
- and the destination IP address.
Extended Numbered IPv4 ACLs
• The IP header’s Protocol field identifies the header that follows the IP header.
• Figure 3-2 shows the location of the IP Protocol field, the concept of it pointing to the type of header that follows,
along with some details of the IP header for reference.
• IOS requires that you configure parameters for the three highlighted parts of Figure 3-2.
• For the protocol type, you simply use a keyword, such as
tcp, udp, or icmp, matching IP packets that happen to have
a TCP, UDP, or ICMP header, respectively, following the IP
header.
• Or you can use the keyword ip, which means “all IPv4
packets.”
• You also must configure some values for the source and destination IP address fields that follow.
Extended Numbered IPv4 ACLs
• Table 3-2 lists several sample access-list commands that use only the required matching parameters.
• This example uses the eq parameter, meaning “equals,” to check the destination port numbers for FTP
control (keyword ftp) and HTTP traffic (keyword www).
• You can use the numeric values—or, for the more popular options, a more obvious text version is valid.
• If you were to type eq 80, the config would show eq www.
• This example enables the ACL in two places on R1: inbound on each serial interface.
• These locations achieve the goal of the ACL.
• However, that initial placement was made to make the point that Cisco suggests that you locate them as
close as possible to the source of the packet.
Extended IP Access Lists Example
• Example 3-2 achieves the same goal as Example 3-1 of stopping Bob’s access to FTP servers at the main site, and it
does so with an ACL on R3.
• The new configuration on R3 meets the goals to filter Bob’s traffic, while also meeting the overarching design goal
of keeping the ACL close to the source of the packets.
• ACL 103 on R3 looks a lot like ACL 101 on R1 from Example 3-1, but this time, the ACL does not bother to check for
the criteria to match Larry’s traffic, because Larry’s traffic will never enter R3’s Ethernet 0 interface.
• ACL 103 filters Bob’s FTP traffic to destinations in subnet 172.16.1.0/24, with all other traffic entering R3’s E0
interface making it into the network.
Named ACLs and ACL Editing
• Figure 3-10 shows just such a conversion, using a simple three-line standard ACL number 1.
Content
• This chapter breaks the topics into three major sections :
- The first section explains the challenges to the IPv4 address space caused by the Internet revolution of the 1990s.
- The second section explains the basic concept behind NAT, how several variations of NAT work, and how the Port
Address Translation (PAT) option conserves the IPv4 address space.
- The final section shows how to configure NAT from the Cisco IOS Software command-line interface (CLI) and how
to troubleshoot NAT.
NAT Concepts
o Need for NAT
• NAT , defined in RFC 3022, allows a host that does not have a valid, registered, globally unique IP address to
communicate with other hosts through the Internet.
• The hosts might be using private addresses or addresses assigned to another organization.
• In either case, NAT allows these addresses that are not Internet ready to continue to be used and still allows
communication with hosts across the Internet.
o Operation
• NAT achieves its goal by using a valid registered
IP address to represent the private address to the
rest of the Internet.
• The NAT function changes the private IP
addresses to publicly registered IP addresses
inside each IP packet, as shown in Figure 10-2 .
Remark :
• Notice that the router, performing NAT, changes the packet’s source IP address when the packet leaves the private
organization.
• The router performing NAT also changes the destination address in each packet that is forwarded back into the
private network.
Network 200.1.1.0 is a registered network in Figure 10-2.
• The NAT feature, configured in the router labeled NAT, performs the translation.
o Static NAT
• Static NAT works just like the example shown in Figure 10-2, but with the IP addresses statically mapped to each
other.
• To help you understand the implications of static NAT and to explain several key terms, Figure 10-3 shows a similar
example with more information.
Explanation :
• First, the company’s ISP has assigned it registered
network 200.1.1.0.
• Therefore, the NAT router must make the private
IP addresses look like they are in network
200.1.1.0.
To do so, the NAT router changes the source IP addresses in the packets going from left to right in the figure.
• In this example, the NAT router changes the source address (SA in the figure) of 10.1.1.1 to 200.1.1.1.
• With static NAT, the NAT router simply configures a one-to-one mapping between the private address and the
registered address that is used on its behalf.
• The NAT router has statically configured a mapping between private address 10.1.1.1 and public, registered
address 200.1.1.1.
o More informations
• Supporting a second IP host with static NAT requires a second static one-to-one mapping using a second
IP address in the public address range.
• For example, to support 10.1.1.2, the router statically maps 10.1.1.2 to 200.1.1.2.
• Because the enterprise has a single registered Class C network, it can support at most 254 private IP
addresses with NAT, with the usual two reserved numbers (the network number and network broadcast
address).
• The terminology used with NAT, particularly with configuration, can be a little confusing.
Important Remark !!!!
• Notice in Figure 10-3 that the NAT table lists the private IP addresses as “private” and the public,
registered addresses from network 200.1.1.0 as “public.”
• Cisco uses the term inside local for the private IP addresses in this example and inside global for the
public IP addresses .
o NAT Terminology (Inside local vs Inside global)
• Using NAT terminology, the enterprise network that uses private addresses, and therefore needs NAT, is the
“inside” part of the network.
• The Internet side of the NAT function is the “outside” part of the network.
• A host that needs NAT (such as 10.1.1.1 in the example) has the IP address it uses inside the network, and it needs
an IP address to represent it in the outside network.
• So, because the host essentially needs two different addresses to represent it, you need two terms.
• Cisco calls the private IP address used in the inside network the inside local address and the address used to
represent the host to the rest of the Internet the inside global address.
• Figure 10-4 repeats the same example, with some of the terminology shown.
o Dynamic NAT
Introduction
• Dynamic NAT has some similarities and differences compared to static NAT.
• Like static NAT, the NAT router creates a one-to-one mapping between an inside local and inside global address,
and changes the IP addresses in packets as they exit and enter the inside network.
• However, the mapping of an inside local address to an inside global address happens dynamically.
Concept
• Dynamic NAT sets up a pool of possible inside
global addresses and defines matching criteria to
determine which inside local IP addresses should
be translated with NAT.
• For example, in Figure 10-5, a pool of five inside
global IP addresses has been established :
200.1.1.1 through 200.1.1.5.
• NAT has also been configured to translate any
inside local addresses that start with
10.1.1.
• The numbers 1, 2, 3, and 4 in the figure refer to the following sequence of events :
1. Host 10.1.1.1 sends its first packet to the server at
170.1.1.1.
2. As the packet enters the NAT router, the router applies
some matching logic to decide whether the packet should
have NAT applied.
Because the logic has been configured to match source IP
addresses that begin with 10.1.1, the router adds an entry
in the NAT table for 10.1.1.1 as an inside local address.
3. The NAT router needs to allocate an IP address from the
pool of valid inside global addresses.
It picks the first one available (200.1.1.1, in this case) and adds it to the NAT table to complete the entry.
4. The NAT router translates the source IP address and forwards the packet.
• You can also manually clear the dynamic entries from the table using the clear ip nat translation * command.
Overloading NAT with PAT (Port Address Translation)
Need & Motivation
• Some networks need to have most, if not all, IP hosts reach the Internet.
• If that network uses private IP addresses, the NAT router needs a very large set of registered IP addresses.
• With static NAT, for each private IP host that needs Internet access, you need a publicly registered IP address,
completely defeating the goal of reducing the number of public IPv4 addresses needed for that organization.
Solution of some issues
• Dynamic NAT lessens the problem to some degree, because every single host in an internetwork should seldom
need to communicate with the Internet at the same time.
• However, if a large percentage of the IP hosts in a network will need Internet access throughout that company’s
normal business hours, NAT still requires a large number of registered IP addresses, again failing to reduce IPv4
address consumption.
• The NAT Overload feature, also called Port Address Translation (PAT), solves this problem.
• Overloading allows NAT to scale to support many clients with only a few public IP addresses.
Overloading NAT with PAT (Port Address Translation)
Need & Motivation
• The key to understanding how overloading works is to recall how hosts use TCP and User Datagram Protocol (UDP)
ports.
• To see why, first consider the idea of 3 separate
TCP connections to a web server, from 3 different
hosts, as shown in Figure 10-6.
• Next, compare those three TCP connections in
Figure 10-6 to three similar TCP connections, now
with all three TCP connections from one client, as
shown in Figure 10-7.
• The server does realize a difference because
the server sees the IP address and TCP port number used by the clients in both figures.
• However, the server really does not care whether the TCP connections come from different hosts or the same
host; the server just sends and receives data over each connection.
• NAT takes advantage of the fact that, from a transport layer perspective, the server doesn’t care whether it has
one connection each to three different hosts or three connections to a single host IP address.
• NAT overload (PAT) translates not only the address, but the port number when necessary, making what looks like
many TCP or UDP flows from different hosts look like the same number of flows from one host.
• Figure 10-8 outlines the logic.
• When PAT creates the dynamic mapping, it selects not only an inside global IP address but also a unique port
number to use with that address.
• The NAT router keeps a NAT table entry for every unique combination of inside local IP address and port, with
translation to the inside global address and a unique port number associated with the inside global address.
• And because the port number field has 16 bits, NAT overload can use more than 65,000 port numbers, allowing it
to scale well without needing many registered IP addresses—in many cases, needing only one inside global IP
address.
NAT Configuration and Troubleshooting
• The following sections describe how to configure the three most common variations of NAT :
- Static NAT,
- Dynamic NAT,
- PAT,
… along with the show and debug commands used to troubleshoot NAT.
Static NAT Configuration
• Static NAT configuration requires only a few configuration steps.
• Each static mapping between a local (private) address and a global (public) address must be configured.
• In addition, because NAT may be used on a subset of interfaces, the router must be told on which interfaces it
should use NAT.
• Those same interface subcommands tell NAT whether the interface is inside or outside.
• The specific steps are as follows :
Static NAT Configuration
• Figure 10-9 shows the familiar network used in the description of static NAT earlier in this chapter, which is also
used for the first several configuration examples.
• In Figure 10-9, you can see that Certskills has obtained Class C network 200.1.1.0 as a registered network number.
• That entire network, with mask 255.255.255.0, is configured on the serial link between Certskills and the Internet.
• With a point-to-point serial link, only two of the 254 valid IP addresses in that network are consumed, leaving 252
addresses.
Important Remark !!!!
• When planning a NAT configuration, you must find some IP addresses to use as inside global IP addresses.
• Because these addresses must be part of some registered IP address range, it is common to use the extra
addresses in the subnet connecting the enterprise to the Internet—for example, the extra 252 IP addresses in
network 200.1.1.0 in this case.
• The router can also be configured with a loopback interface and assigned an IP address that is part of a globally
unique range of registered IP addresses.
• Example 10-1 lists the NAT configuration, using 200.1.1.1 and 200.1.1.2 for the two static NAT mappings.
Important command to set NAT !!!!
=> The static mappings are created using the ip nat inside source static command.
• The inside keyword means that NAT translates addresses for hosts on the inside part of the network.
• The source keyword means that NAT translates the source IP address of packets coming into its inside interfaces.
• The static keyword means that the parameters define a static entry, which should never be removed from the NAT
table because of timeout.
• Because the design calls for two hosts—10.1.1.1 and 10.1.1.2—to have Internet access, 2 ip nat inside commands
are needed.
• After creating the static NAT entries, the router needs to know which interfaces are “inside” and which are
“outside.”
• The ip nat inside and ip nat outside interface subcommands identify each interface appropriately.
Other commands :
• A couple of show commands list the most important information about NAT.
• The show ip nat translations command lists the two static NAT entries created in the configuration.
• The show ip nat statistics command lists statistics, listing things such as the number of currently active translation
table entries.
• The statistics also include the number of hits, which increments for every packet for which NAT must translate
addresses.
Dynamic NAT Configuration
• Dynamic NAT still requires that each interface be identified as either an inside or outside interface, and of course
static mapping is no longer required.
Dynamic NAT uses an access control list (ACL) to identify which inside local (private) IP addresses need to have
their addresses translated, and it defines a pool of registered public IP addresses to allocate.
• The specific steps are as follows :
• The next example shows a sample dynamic NAT configuration using the same network topology as the previous
example (see Figure 10-9).
• In this case, the same two inside local addresses—10.1.1.1 and 10.1.1.2—need translation.
• However, unlike the previous static NAT example, the configuration in Example 10-2 places the public IP addresses
(200.1.1.1 and 200.1.1.2) into a pool of dynamically assignable inside global addresses.