Complete Cisco Nexus Static Routing & Loopback Configuration Lab
This advanced Cisco networking tutorial explains how to configure loopback interfaces, default routes, static routes, and end-to-end routing between Cisco routers and Cisco Nexus switches. The tutorial also explains the theory behind static routing, routing table lookups, administrative distance, binary subnetting, and route verification.
Table of Contents
- 1. Lab Overview
- 2. Understanding Loopback Interfaces
- 3. Task 1 - Configure Loopback Interfaces
- 4. Task 2 - Configure Default Routes
- 5. Task 3 - Configure Static Routes on NX-01
- 6. Task 4 - Configure Static Routes on NX-02
- 7. Task 5 - Configure Static Routes on R1 towards R2
- 8. Task 6 - Configure End-to-End Static Routing
- 9. Task 7 - Verify Connectivity using Ping
- 10. Routing Mathematics
- 11. Verification Commands
- 12. Troubleshooting Static Routing
- 13. Related Articles
- 14. Conclusion
1. Lab Overview
Static routing is one of the most fundamental routing concepts in networking. Unlike dynamic routing protocols such as OSPF, EIGRP, or BGP, static routing requires manual route configuration by the network administrator.
This lab demonstrates:
- Loopback interface configuration
- Static routing concepts
- Default routing
- Route forwarding logic
- End-to-end Layer 3 connectivity
- Route verification
- Troubleshooting techniques
Routing Table Mathematics
If a router contains:
- 5 connected routes
- 10 static routes
- 20 dynamic routes
Total routing entries:
\[ 5 + 10 + 20 = 35 \]
2. Understanding Loopback Interfaces
Loopback interfaces are logical virtual interfaces inside a router or switch. They are always considered up unless administratively shutdown.
Why Engineers Use Loopbacks
- Always stable
- Independent of physical interfaces
- Used for router IDs
- Ideal for testing routing
- Simplifies network management
- Useful for simulation labs
Loopback /32 Mathematics
A /32 mask represents:
\[ 255.255.255.255 \]
This creates exactly:
\[ 2^{(32-32)} = 1 \]
Therefore, only one usable IP address exists.
3. Task 1 - Configure Loopback Interfaces
Each device will receive three loopback interfaces:
- Loopback0
- Loopback1
- Loopback10
This structure simulates enterprise routing environments where devices advertise multiple networks.
R1 Loopback Configuration
interface loopback0
ip address 1.1.1.1 255.0.0.0
interface loopback1
ip address 100.1.1.1 255.255.255.0
interface loopback10
ip address 10.1.1.1 255.255.255.255
R2 Loopback Configuration
interface loopback0
ip address 2.2.2.2 255.0.0.0
interface loopback1
ip address 100.1.2.2 255.255.255.0
interface loopback10
ip address 10.1.1.2 255.255.255.255
NX-01 Loopback Configuration
interface loopback0
ip address 121.121.121.121 255.0.0.0
interface loopback1
ip address 100.1.21.21 255.255.255.0
interface loopback10
ip address 10.1.1.21 255.255.255.255
NX-02 Loopback Configuration
interface loopback0
ip address 122.122.122.122 255.0.0.0
interface loopback1
ip address 100.1.22.22 255.255.255.0
interface loopback10
ip address 10.1.1.22 255.255.255.255
NX-03 Loopback Configuration
interface loopback0
ip address 123.123.123.123 255.0.0.0
interface loopback1
ip address 100.1.23.23 255.255.255.0
interface loopback10
ip address 10.1.1.23 255.255.255.255
NX-04 Loopback Configuration
interface loopback0
ip address 124.124.124.124 255.0.0.0
interface loopback1
ip address 100.1.24.24 255.255.255.0
interface loopback10
ip address 10.1.1.24 255.255.255.255
Understanding Different Prefix Lengths
| Subnet | Mask | Hosts |
|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 |
| /24 | 255.255.255.0 | 254 |
| /32 | 255.255.255.255 | 1 |
4. Task 2 - Configure Default Routes
A default route is used when no specific route exists in the routing table. It acts as a gateway of last resort.
Longest Prefix Match Mathematics
Given these routes:
- \(10.0.0.0/8\)
- \(10.1.0.0/16\)
- \(10.1.1.0/24\)
For destination:
\[ 10.1.1.5 \]
The router selects:
\[ 10.1.1.0/24 \]
because it is the longest prefix match.
NX-01 Default Route
ip route 0.0.0.0/0 192.1.10.1
NX-02 Default Route
ip route 0.0.0.0/0 192.1.20.1
NX-03 Default Route
ip route 0.0.0.0/0 192.1.30.21
NX-04 Default Route
ip route 0.0.0.0/0 192.1.40.22
R2 Default Route
ip route 0.0.0.0 0.0.0.0 192.1.12.1
Why Default Routes Matter
Without a default route, unknown destinations are dropped. Default routes simplify routing table management in smaller networks.
5. Task 3 - Configure Static Routes on NX-01
NX-01 must learn the loopback networks behind NX-03.
NX-01 Static Routes
ip route 10.1.1.23/32 192.1.30.23
ip route 100.1.23.0/24 192.1.30.23
ip route 123.0.0.0/8 192.1.30.23
NX-01# show ip route static
S 10.1.1.23/32 [1/0] via 192.1.30.23
S 100.1.23.0/24 [1/0] via 192.1.30.23
S 123.0.0.0/8 [1/0] via 192.1.30.23
6. Task 4 - Configure Static Routes on NX-02
NX-02 now requires reachability toward NX-04 loopback networks.
NX-02 Static Routes
ip route 10.1.1.24/32 192.1.40.24
ip route 100.1.24.0/24 192.1.40.24
ip route 124.0.0.0/8 192.1.40.24
Administrative Distance Mathematics
Static routes normally use:
\[ AD = 1 \]
Connected routes use:
\[ AD = 0 \]
Lower administrative distance means higher trust.
7. Task 5 - Configure Static Routes on R1 towards R2
R1 requires reachability toward all loopbacks behind R2.
R1 Static Routes
ip route 10.1.1.2 255.255.255.255 192.1.12.2
ip route 100.1.2.0 255.255.255.0 192.1.12.2
ip route 2.0.0.0 255.0.0.0 192.1.12.2
Understanding Next-Hop Routing
The next-hop address tells the router where packets should be forwarded.
Example:
ip route 2.0.0.0 255.0.0.0 192.1.12.2
This means:
- Destination network = 2.0.0.0/8
- Forward packets to = 192.1.12.2
8. Task 6 - Configure End-to-End Static Routing
This task creates full end-to-end connectivity between R1 and all Nexus switch loopbacks.
R1 Static Routes towards NX-01
ip route 10.1.1.21 255.255.255.255 192.1.10.21
ip route 100.1.21.0 255.255.255.0 192.1.10.21
ip route 121.0.0.0 255.0.0.0 192.1.10.21
R1 Static Routes towards NX-03
ip route 10.1.1.23 255.255.255.255 192.1.10.21
ip route 100.1.23.0 255.255.255.0 192.1.10.21
ip route 123.0.0.0 255.0.0.0 192.1.10.21
R1 Static Routes towards NX-02
ip route 10.1.1.22 255.255.255.255 192.1.20.22
ip route 100.1.22.0 255.255.255.0 192.1.20.22
ip route 122.0.0.0 255.0.0.0 192.1.20.22
R1 Static Routes towards NX-04
ip route 10.1.1.24 255.255.255.255 192.1.20.22
ip route 100.1.24.0 255.255.255.0 192.1.20.22
ip route 124.0.0.0 255.0.0.0 192.1.20.22
9. Task 7 - Verify Connectivity using Ping
After configuring routes, connectivity testing is mandatory.
Ping Verification Examples
R1# ping 10.1.1.24
!!!!!
Success rate is 100 percent
NX-01# ping 123.123.123.123
64 bytes from 123.123.123.123
R1# ping
Protocol [ip]:
Target IP address: 10.1.1.23
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: loopback10
10. Routing Mathematics
Binary Subnetting Example
Subnet mask:
\[ 255.255.255.0 \]
Binary:
\[ 11111111.11111111.11111111.00000000 \]
Network Calculation
IP:
\[ 192.1.12.25 \]
Mask:
\[ 255.255.255.0 \]
Network:
\[ 192.1.12.0 \]
Usable Hosts Formula
\[ 2^h - 2 \]
For /24:
\[ 2^8 - 2 = 254 \]
Forwarding Logic Mathematics
If routing table contains:
- \(10.0.0.0/8\)
- \(10.1.0.0/16\)
- \(10.1.1.0/24\)
- \(10.1.1.1/32\)
Packet destination:
\[ 10.1.1.1 \]
Selected route:
\[ 10.1.1.1/32 \]
because /32 is the most specific prefix.
11. Verification Commands
| Command | Purpose |
|---|---|
| show ip route | Displays routing table |
| show ip interface brief | Displays interface states |
| ping | Tests connectivity |
| traceroute | Displays packet path |
| show running-config | Displays active configuration |
Example show ip route Output
R1# show ip route
C 192.1.12.0/24 is directly connected
S 123.0.0.0/8 [1/0] via 192.1.10.21
S 124.0.0.0/8 [1/0] via 192.1.20.22
12. Troubleshooting Static Routing
Static routing issues are usually caused by:
- Wrong next-hop IP address
- Missing return routes
- Incorrect subnet masks
- Interface shutdown state
- Layer 2 connectivity issues
Troubleshooting Workflow
- Check interface status
- Verify IP addresses
- Check routing table
- Verify next-hop reachability
- Test using ping
- Use traceroute for path analysis
show ip route static
show ip arp
show interface brief
show cdp neighbors
traceroute 10.1.1.24
13. Related Articles
- Part 1 - Complete Cisco Nexus VLAN Trunking Configuration Guide
- Part 3 - Complete Cisco Nexus EIGRP Redistribution Lab Configuration Guide with Multi-AS Routing
14. Conclusion
This Cisco Nexus static routing lab provided deep practical experience with:
- Loopback interface configuration
- Static routing
- Default routing
- Routing table verification
- End-to-end Layer 3 connectivity
- Route troubleshooting
Understanding static routing is extremely important because it builds the foundation for advanced routing protocols such as:
- OSPF
- EIGRP
- BGP
- IS-IS
No comments:
Post a Comment