1. 程式人生 > >cisco靜態路由

cisco靜態路由

cisco 思科 單臂路由

1.1靜態路由基本配置

1.1.1實驗目的:

為路由器配置靜態路由,從而了解路由發上的過程。

1.1.2實驗拓撲:

技術分享

1.1.3實驗配置:

R2的配置:

interface Loopback0

ip address 2.2.2.2 255.255.255.0

interface Serial0/2

ip address 26.26.26.2 255.255.255.0

ip route 3.3.3.0 255.255.255.0 26.26.26.6

ip route 6.6.6.0 255.255.255.0 26.26.26.6

ip route 36.36.36.0 255.255.255.0 26.26.26.6

R6的配置:

interface Loopback0

ip address 6.6.6.6 255.255.255.0

interface Serial0/2

ip address 26.26.26.6 255.255.255.0

interface Serial0/3

ip address 36.36.36.6 255.255.255.0

ip route 2.2.2.0 255.255.255.0 26.26.26.2

ip route 3.3.3.0 255.255.255.0 36.36.36.3

R3的配置:

interface Loopback0

ip address 3.3.3.3 255.255.255.0

interface Serial0/3

ip address 36.36.36.3 255.255.255.0

ip route 2.2.2.0 255.255.255.0 36.36.36.6

ip route 6.6.6.0 255.255.255.0 36.36.36.6

ip route 26.26.26.0 255.255.255.0 36.36.36.6

1.1.4驗證:

查看路由表,並PING每個路由器的回環接口。

R2

R2#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0

3.0.0.0/24 is subnetted, 1 subnets

S 3.3.3.0 [1/0] via 26.26.26.6

36.0.0.0/24 is subnetted, 1 subnets

S 36.36.36.0 [1/0] via 26.26.26.6

6.0.0.0/24 is subnetted, 1 subnets

S 6.6.6.0 [1/0] via 26.26.26.6

26.0.0.0/24 is subnetted, 1 subnets

C 26.26.26.0 is directly connected, Serial0/2

R2#ping 6.6.6.6

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 28/53/132 ms

R2#ping 3.3.3.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 68/92/144 ms

R6

R6#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

2.0.0.0/24 is subnetted, 1 subnets

S 2.2.2.0 [1/0] via 26.26.26.2

3.0.0.0/24 is subnetted, 1 subnets

S 3.3.3.0 [1/0] via 36.36.36.3

36.0.0.0/24 is subnetted, 1 subnets

C 36.36.36.0 is directly connected, Serial0/3

6.0.0.0/24 is subnetted, 1 subnets

C 6.6.6.0 is directly connected, Loopback0

26.0.0.0/24 is subnetted, 1 subnets

C 26.26.26.0 is directly connected, Serial0/2

R6#ping 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/46/92 ms

R6#ping 3.3.3.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 32/61/116 ms

R3

R3#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

2.0.0.0/24 is subnetted, 1 subnets

S 2.2.2.0 [1/0] via 36.36.36.0

3.0.0.0/24 is subnetted, 1 subnets

C 3.3.3.0 is directly connected, Loopback0

36.0.0.0/24 is subnetted, 1 subnets

C 36.36.36.0 is directly connected, Serial0/3

6.0.0.0/24 is subnetted, 1 subnets

S 6.6.6.0 [1/0] via 36.36.36.6

26.0.0.0/24 is subnetted, 1 subnets

S 26.26.26.0 [1/0] via 36.36.36.0

R3#ping 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 28/78/136 ms

R3#ping 6.6.6.6

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 6.6.6.6, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 16/57/140 ms

1.2靜態路由(2)

1.2.1實驗目的:

在全網互訪的基礎上,實現R2的2.2.2.2可以訪問R3的3.3.3.3。但R2的26.26.26.2不可以訪問R3的3.3.3.3。

1.2.2實驗拓撲:

1.2.3實驗配置:

R2的配置:

interface Loopback0

ip address 2.2.2.2 255.255.255.0

interface Serial0/2

ip address 26.26.26.2 255.255.255.0

ip route 3.3.3.0 255.255.255.0 26.26.26.6

ip route 6.6.6.0 255.255.255.0 26.26.26.6

ip route 36.36.36.0 255.255.255.0 26.26.26.6

R6的配置:

interface Loopback0

ip address 6.6.6.6 255.255.255.0

interface Serial0/2

ip address 26.26.26.6 255.255.255.0

interface Serial0/3

ip address 36.36.36.6 255.255.255.0

ip route 2.2.2.0 255.255.255.0 26.26.26.2

ip route 3.3.3.0 255.255.255.0 36.36.36.3

R3的配置:

interface Loopback0

ip address 3.3.3.3 255.255.255.0

interface Serial0/3

ip address 36.36.36.3 255.255.255.0

ip route 2.2.2.0 255.255.255.0 36.36.36.6

ip route 6.6.6.0 255.255.255.0 36.36.36.6

ip route2 6.26.26.6 255.255.255.255 36.36.36.6

1.2.4驗證:

R2#ping 3.3.3.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

.....

Success rate is 0 percent (0/5)

R2#ping 3.3.3.3 sou

R2#ping 3.3.3.3 source 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:

Packet sent with a source address of 2.2.2.2

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 56/81/124 ms

1.3浮動靜態路由

1.3.1實驗目的:

使用浮動靜態路由,實現路由備份。

觀察動態路由EIGRP與靜態路由之間的轉換。

1.3.2實驗拓撲:

1.3.3實驗配置:

R2的配置:

interface Loopback0

ip address 2.2.2.2 255.255.255.0

interface Serial0/2

ip address 26.26.26.2 255.255.255.0

interface Ethernet1/1

ip address 62.62.62.2 255.255.255.0

router eigrp 90

network 2.0.0.0

network 26.0.0.0

no auto-summary

ip route 6.6.6.0 255.255.255.0 62.62.62.6 100

R6的配置:

interface Loopback0

ip address 6.6.6.6 255.255.255.0

interface Serial0/2

ip address 26.26.26.6 255.255.255.0

interface Ethernet1/1

ip address 62.62.62.6 255.255.255.0

router eigrp 90

network 6.0.0.0

network 26.0.0.0

no auto-summary

ip route 2.2.2.0 255.255.255.0 62.62.62.2 100

1.3.4實驗驗證:

R6#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

2.0.0.0/24 is subnetted, 1 subnets

D 2.2.2.0 [90/2297856] via 26.26.26.2, 00:00:20, Serial0/2

6.0.0.0/24 is subnetted, 1 subnets

C 6.6.6.0 is directly connected, Loopback0

26.0.0.0/24 is subnetted, 1 subnets

C 26.26.26.0 is directly connected, Serial0/2

62.0.0.0/24 is subnetted, 1 subnets

C 62.62.62.0 is directly connected, Ethernet1/1

R2#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

2.0.0.0/24 is subnetted, 1 subnets

C 2.2.2.0 is directly connected, Loopback0

6.0.0.0/24 is subnetted, 1 subnets

D 6.6.6.0 [90/2297856] via 26.26.26.6, 00:00:32, Serial0/2

26.0.0.0/24 is subnetted, 1 subnets

C 26.26.26.0 is directly connected, Serial0/2

62.0.0.0/24 is subnetted, 1 subnets

C 62.62.62.0 is directly connected, Ethernet1/1

R6#traceroute 2.2.2.2

Type escape sequence to abort.

Tracing the route to 2.2.2.2

1 26.26.26.2 88 msec 76 msec *

當把S0/2接口shutdown

R6#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

2.0.0.0/24 is subnetted, 1 subnets

S 2.2.2.0 [100/0] via 62.62.62.2

6.0.0.0/24 is subnetted, 1 subnets

C 6.6.6.0 is directly connected, Loopback0

62.0.0.0/24 is subnetted, 1 subnets

C 62.62.62.0 is directly connected, Ethernet1/1

R6#ping 2.2.2.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 44/74/164 ms

當接口S0/2 no shutdown:

路由表中重新又有了EIGRP學到的路由

R6#show ip route

Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2

i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2

ia - IS-IS inter area, * - candidate default, U - per-user static route

o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

2.0.0.0/24 is subnetted, 1 subnets

D 2.2.2.0 [90/2297856] via 26.26.26.2, 00:00:08, Serial0/2

6.0.0.0/24 is subnetted, 1 subnets

C 6.6.6.0 is directly connected, Loopback0

26.0.0.0/24 is subnetted, 1 subnets

C 26.26.26.0 is directly connected, Serial0/2

62.0.0.0/24 is subnetted, 1 subnets

C 62.62.62.0 is directly connected, Ethernet1/1

本文出自 “高家大少的技術博客” 博客,請務必保留此出處http://gpj1997.blog.51cto.com/12830710/1940994

cisco靜態路由