Saturday, January 3, 2009

IPexpert Volume 2 Section 14 Review

I just completed this lab in about 4 hours. I spent some time before my session started drawing diagrams and reading through the lab. I find this helps me save session time in case I take too long. Plus it gives me substantial time to grade the lab, verify solutions and even test out the solution guide if needed.

I only missed a few tasks, and some of these were because I was unfamiliar with commands and I made the solution too difficult.

-3 Task 7.3 BGP
I needed to provide redundant BGP connectivity after filtering some routes. I misunderstood this task, we needed an aggregate with as-set and I left it off.

-2 Task 7.5 BGP
I had to prevent AS paths of 16 or longer. I created an enormously large as-path ACL when all that was required was max-as limit. I know this command but I just had a brain fart.

-3 Task 10.1 CQ
Custom Queuing task had some extra stuff to throw you off. Very tricky ;-)

-3 Task 11.3 Multicast
For rate limiting multicast I used normal CAR, but there actually exists a special multicast rate-limit command.

There were several peculiar service tasks that I am getting the hang of now. I had to compress the config, decreases the telnet timeout, and some other stuff. Browsing the DocCD as well as the context sensitive help as helped me with these kinds of tasks.

A little less than 2 months to go now. I have been doing pretty well on 8 hour labs. Lately I have working on improving my verification habits. After a lab, I force myself to review almost every single task, even things like VLAN assignments. I always find a couple errors and I have been reducing my bonehead mistakes by a lot.

One more Volume 2 lab to go then I will probably stick with doing my own labs and Volume 3 graded mock labs.

Friday, January 2, 2009

NAT on a Stick

NAT on a stick can get pretty confusing. Here is a lab I put together with the help of an example on Cisco site. I don't know if it is accessible through the DocCD so here is the link:

Network Address Translation on a Stick

The topology is a little different because I am using routers without any cable devices:


R2 is a host on the 10.0.0.0/24 network. It is using 10.0.0.1 (R1) as the gateway. R1 then NATs this address to 192.168.2.X before sending the packet on its way to R3. That's the basic rundown but the configuration is a little more complex.

First things first...Since 192.168.2.0 will be our translated address range make sure R4 and R3 both have routes to this range. R3 will use 192.168.1.1 as the next hop and R4 will use 100.0.0.3.

The rest of the configuration is on R1. Assign two addresses to R1 and configure it as our inside interface. 10.0.0.1 is used as a gateway address for hosts on the LAN and 192.168.1.1 is used to communicate with R3.

interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.0 secondary
ip address 10.0.0.1 255.255.255.0
ip nat inside


Create the loopback that will be used as our outside interface. Keep in mind we are using a /30 network, you will see why a little later on.

interface Loopback0
ip address 10.0.1.1 255.255.255.252
ip nat outside


Next define an ACL to match our inside hosts then configure the NAT pool and NAT statements:

access-list 10 permit 10.0.0.0 0.0.0.255
ip nat pool NAT 192.168.2.100 192.168.2.200 prefix-length 24
ip nat inside source list 10 pool NAT


Now this is where it get's a little tricky. I am trying to do this in a logical order, but in reality I just have to memorize what needs to be configured to finish this thing off.

Since the 192.168.2.0 network does not exist on any interface we tell R1 that it exists of F0/0 like this:

ip route 192.168.2.0 255.255.255.0 FastEthernet0/0

Finally, we add our policy routing configuration. Remember the ACL has to match traffic in both directions:

access-list 100 permit ip any 192.168.2.0 0.0.0.255
access-list 100 permit ip 10.0.0.0 0.0.0.255 any

route-map NAT-LOOP permit 10
match ip address 100
set ip next-hop 10.0.1.2

interface FastEthernet0/0
ip policy route-map NAT-LOOP


So now R1 knows to policy route any traffic coming from 10.0.0.0/24 or going towards 192.168.2.0/24. The next hop address is 10.0.1.2 which technically exists on the Loopback 0 network. Since our loopback has the NAT outside statement, translation occurs here.

Let's test:

R2#ping 100.0.0.4

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.0.0.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/60/112 ms
R2#

R1#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 192.168.2.100:8 10.0.0.2:8 100.0.0.4:8 100.0.0.4:8
--- 192.168.2.100 10.0.0.2 --- ---
R1#


Key things to remember about NAT on a Stick:

-Ensure upstream routers have to routes back to the NAT (outside) address
-ACL for policy routing is 2-way
-Loopback is used for outside interface, but the NAT pool is on a separate network.
-Use a route pointing to the LAN interface to tell the router where the outside network resides.

There are probably some variations of this configuration that will work. I am going to play around with some now, but that should be enough to get started.

Thursday, January 1, 2009

HSRP and Redirects

HSRP is fairly easy to understand and configure but the more you dig into something there is always something new you are bound to find. This goes for me today with HSRP redirection. Honestly, I never really bothered to look into the topic too much but reading through the DocCD today kind of piqued my curiosity.

Here is the topology for this lab which I borrowed from the configuration guide. I would post a link but that would be too easy, I figured I'd let you practice finding it :)


The topology is big but my focus is on what R1 does based on what it knows about the HSRP status of all the other routers. Since all routers are doing OSPF, R1 learns about 172.16.34.0/24 from R3 and R4 and it learns about 172.16.8.0/24 from R8.

R9 is NOT doing OSPF and using the standby group 1 address of 192.168.1.100 as its default gateway. In normal operation R1 would send redirects to R9 if it received packets for the R8 or the R3/R4 network. When HSRP is in use (with a default config), it only sends redirects for the R8 network.

Before we test, enable "debug ip icmp" on all routers as well as "debug standby events" on R1. Let's see what happens when R9 pings 172.168.8.8:

R9#ping 172.16.8.8 re 1

Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 172.16.8.8, timeout is 2 seconds:
!
Success rate is 100 percent (1/1), round-trip min/avg/max = 124/124/124 ms
R9#
*Mar 1 01:29:20.207: ICMP: redirect rcvd from 192.168.1.100- for 172.16.8.8 use gw 192.168.1.8
*Mar 1 01:29:20.263: ICMP: echo reply rcvd, src 172.16.8.8, dst 192.168.1.9


This is what we see on R1:

R1#
*Mar 1 01:30:15.771: ICMP: Use HSRP virtual address 192.168.1.100 as ICMP src
*Mar 1 01:30:15.775: ICMP: redirect sent to 192.168.1.9 for dest 172.16.8.8, use gw 192.168.1.8


Now look what happens when we ping 172.16.34.3:

R9#ping 172.16.34.3 re 1

Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 172.16.34.3, timeout is 2 seconds:
!
Success rate is 100 percent (1/1), round-trip min/avg/max = 112/112/112 ms
*Mar 1 01:30:54.407: ICMP: echo reply rcvd, src 172.16.34.3, dst 192.168.1.9


The ping succeeded of course but we did not get a redirect. The packet actually hops from R1 to R4, then the reply goes to R9. On R1 we see this:

R1#
*Mar 1 01:30:56.187: ICMP: redirect not sent to 192.168.1.9 for dest 172.16.34.3
*Mar 1 01:30:56.191: ICMP: 192.168.1.4 does not contain an active HSRP group


The reason R1 does not send a redirect is because R4 is not active for any groups. For all R1 knows, R4 is not active for a reason and thus should not send redirects for it. But how does R1 know this? It keeps track of all the HSRP messages it hears. We can view this as follows:

R1#sho standby redirect
Interface Redirects Unknown Adv Holddown
FastEthernet0/0 enabled enabled 30 180

Active Hits Interface Group Virtual IP Virtual MAC
local 0 FastEthernet0/0 1 192.168.1.100 0000.0c07.ac01
192.168.1.3 0 FastEthernet0/0 3 192.168.1.200 0000.0c07.ac03

Passive Hits Interface Expires in
192.168.1.2 0 FastEthernet0/0 179.856
192.168.1.4 4 FastEthernet0/0 162.824
R1#


Notice that R3 is an Active router for a group. R1 would send a redirect if R3 was listed as the next hop, but in this case R3 and R4 are equal costs and R4 is being picked. In spite of all this we can trick R1 into sending redirects by making R4 Active for a group. Let's enable group 4 only on R4 to ensure it becomes Active, then ping again from R9:

R4(config)#int f0/0
R4(config-if)#standby 4 ip 192.168.1.204


R1#sho stan re active
Active Hits Interface Group Virtual IP Virtual MAC
local 0 FastEthernet0/0 1 192.168.1.100 0000.0c07.ac01
192.168.1.3 0 FastEthernet0/0 3 192.168.1.200 0000.0c07.ac03
192.168.1.4 0 FastEthernet0/0 4 192.168.1.204 0000.0c07.ac04

R9#ping 172.16.34.3 re 1

Type escape sequence to abort.
Sending 1, 100-byte ICMP Echos to 172.16.34.3, timeout is 2 seconds:
!
Success rate is 100 percent (1/1), round-trip min/avg/max = 80/80/80 ms
R9#
*Mar 1 01:35:44.703: ICMP: redirect rcvd from 192.168.1.100- for 172.16.34.3 use gw 192.168.1.204
*Mar 1 01:35:44.739: ICMP: echo reply rcvd, src 172.16.34.3, dst 192.168.1.9


We got a redirect! What's interesting about this behavior is that R1 knows the difference between a network behind HSRP routers and a network behind a non-HSRP router. It knows this by learning which routers are sending HSRP messages and comparing them to the next hops in its route table. So if you every get a tricky task about HSRP and redirects, I hope this helps shed some light on it.

Before I go, here is some more food for thought:

R1(config-if)#standby redirect ?
advertisement Redirect advertisement messages
timers Adjust redirect timers
unknown Redirect to non-HSRP routers