Lab Objective:
The focus of this lab is to understand Cisco IOS NetFlow implementation and configuration in Cisco IOS routers. Additional technologies include Cisco IOS IP Accounting.
Lab Topology:
|
IMPORTANT NOTE If you are using the www.howtonetwork.net racks, please bring up the LAN interfaces connected to the routers by issuing the no shutdown command on the connected switches. If you are using a home lab with no interface fastethernet 0/0 Alternately, you can simply connect the interfaces to a hub or switch if you have one available in your own lab. |
Task 1
Configure hostnames and IP address on all routers as illustrated in the topology.
Task 2
Configure OSPF on all routers as illustrated in the topology. Verify your configuration using the appropriate commands.
Task 3
Configure Cisco IOS IP accounting on all router WAN interfaces. All routers should store IP accounting information for all packets egressing the WAN interfaces. Verify your IP accounting configuration using the appropriate commands.
Task 4
Configure Cisco IOS NetFlow on all routers. All routers should collect forward statistics for all ingress flows to host 192.168.1.254 using NetFlow version 5 and a destination port of 8000. This traffic should be sourced from the FastEthernet 0/0 interface of all routers.
Task 5
Assume that R1 is a core Internet router. To ensure that as much NetFlow information is stored, configure the router to store up to 128K (131072) entries in the cache. Additionally, configure Cisco IOS NetFlow on this router so that export statistics include the originating autonomous system (AS) for the source and destination. And finally, because R1 will be receiving traffic from multiple hosts on the LAN subnet, configure Cisco IOS NetFlow so that the router captures the MAC addresses of the incoming source and the outgoing destination from the first Layer 2 frame in the flow. Verify your configuration.
Lab Validation
Task 1
Please refer to previous labs for basic IPv4, IPv6 addressing and hostname configuration. This will not be included in this section to avoid being redundant.
Task 2
Please refer to previous labs for basic EIGRP configuration. Following this, verify your OSPF configuration using the show ip ospf neighbor and show ip route commands. Following this configuration, your route tables should show the following route information:
| R1#show ip route ospf 10.0.0.0/30 is subnetted, 2 subnets O 10.0.0.8 [110/128] via 10.0.0.2, 00:14:34, Serial0/0 150.2.0.0/24 is subnetted, 1 subnets O 150.2.2.0 [110/65] via 10.0.0.2, 00:14:34, Serial0/0 150.3.0.0/24 is subnetted, 1 subnets O 150.3.3.0 [110/129] via 10.0.0.2, 00:14:34, Serial0/0 |
| R2#show ip route ospf 150.1.0.0/24 is subnetted, 1 subnets O 150.1.1.0 [110/65] via 10.0.0.1, 00:14:39, Serial0/0 150.3.0.0/24 is subnetted, 1 subnets O 150.3.3.0 [110/65] via 10.0.0.10, 00:14:39, Serial0/1 |
| R3#show ip route ospf 10.0.0.0/30 is subnetted, 2 subnets O 10.0.0.0 [110/845] via 10.0.0.9, 00:14:36, Serial1/1 150.1.0.0/24 is subnetted, 1 subnets O 150.1.1.0 [110/846] via 10.0.0.9, 00:14:36, Serial1/1 150.2.0.0/24 is subnetted, 1 subnets O 150.2.2.0 [110/782] via 10.0.0.9, 00:14:36, Serial1/1 |
Task 3
While not as granular and detailed as Cisco IOS NetFlow, Cisco IOS IP accounting can be a very powerful troubleshooting tool. IP accounting allows administrators to configure the router to record the number of bytes (IP header and data) and packets switched through the system on a source and destination IP address basis. Only transit IP traffic is measured and only on an outbound basis; traffic generated by the router access server or terminating in this device is not included in the accounting statistics. This task is completed as follows:
| R1(config)#interface serial 0/0 R1(config-if)#ip accounting output-packets R1(config-if)#exit |
| R2(config)#interface serial 0/0 R2(config-if)#ip accounting output-packets R2(config-if)#exit R2(config)#interface serial 0/1 R2(config-if)#ip accounting output-packets R2(config-if)#exit |
| R3(config)#interface serial 1/1 R3(config-if)#ip accounting output-packets R3(config-if)#exit |
Next, verify your configuration using the show ip accounting command. Keep in mind that IP accounting does not capture traffic generated by the local router. Only transit traffic statistics are kept. Therefore, to test, you can ping and Telnet, etc, between R1 and R3 and then verify the statistics on R2 as the traffic will transit that router.
| R2#show ip accounting output-packets Source Destination Packets Bytes 150.1.1.1 10.0.0.10 100 150000 10.0.0.10 150.1.1.1 100 150000 150.3.3.3 10.0.0.1 105 50500 10.0.0.1 150.3.3.3 105 50500 |
Task 4
This task is straightforward and is completed as follows:
| R1(config)#interface fastethernet 0/0 R1(config-if)#ip flow ingress R1(config-if)#exit R1(config)#ip flow-export destination 192.168.1.254 8000 R1(config)#ip flow-export version 5 R1(config)#ip flow-export source fastethernet 0/0 |
| R2(config)#interface fastethernet 0/0 R2(config-if)#ip flow ingress R2(config-if)#exit R2(config)#ip flow-export destination 192.168.1.254 8000 R2(config)#ip flow-export version 5 R2(config)#ip flow-export source fastethernet 0/0 |
| R3(config)#interface fastethernet 0/0 R3(config-if)#ip flow ingress R3(config-if)#exit R3(config)#ip flow-export destination 192.168.1.254 8000 R3(config)#ip flow-export version 5 R3(config)#ip flow-export source fastethernet 0/0 |
Next, verify your configuration using the show ip cache flow command. If you have hosts that are connected to one of the LAN subnets on any of the routers, you can generate some traffic, e.g. pings, Telnet, HTTP, etc, to view information on traffic statistics that will be sent to the NetFlow Collector specified in the previous lab tasks:
| R1#show ip cache flow IP packet size distribution (322 total packets): 1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480 .000 .183 .000 .099 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 512 544 576 1024 1536 2048 2560 3072 3584 4096 4608 IP Flow Switching Cache, 278544 bytes SrcIf SrcIPaddress DstIf DstIPaddress Pr SrcP DstP Pkts |
Task 5
The requirements in this task are straightforward. In order to change the default cache size from 65535 (64K) to a new value, you need to disable NetFlow on all interfaces first or reboot the router following the change. If not, the router will print the following message on the console:
| R1(config)#ip flow-cache entries 131072 %The change in number of entries will take effect after either the next reboot or when netflow is turned off on all interfaces. |
By default, with Cisco IOS NetFlow, values from Layer 2 and Layer 3 fields are not captured. This default behavior, however, can be changed by using the ip flow-capture <option> command in global configuration mode. This task is completed as follows:
| R1(config)#interface fastethernet 0/0 R1(config-if)#no ip flow ingress R1(config-if)#exit R1(config)#ip flow-cache entries 131072 R1(config)#ip flow-export version 5 origin-as R1(config)#ip flow-capture mac-addresses R1(config)#interface fastethernet 0/0 R1(config-if)#ip flow ingress R1(config-if)#exit |
Next, verify your configuration using the show ip cache verbose flow command:
| R1#show ip cache verbose flow IP packet size distribution (342 total packets): 1-32 64 96 128 160 192 224 256 288 320 352 384 416 448 480 .000 .230 .000 .093 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 .000 512 544 576 1024 1536 2048 2560 3072 3584 4096 4608 IP Flow Switching Cache, 8913408 bytes SrcIf SrcIPaddress DstIf DstIPaddress Pr TOS Flgs Pkts |
Final Router Configurations
R1
|
R1#term len 0 Current configuration : 1135 bytes R1# |
R2
|
R2#term len 0 Current configuration : 1101 bytes R2# |
R3
|
R3#term len 0 Current configuration : 1402 bytes R3# |
