靜態路由

實驗二、靜態路由 

 環境:兩臺2500系列路由器通過串口相連。

要求:在R1和R2上啓用靜態路由,使兩端網絡能夠互通。

步驟一、基本配置

Router>

Router>enable

Router#config terminal

Router(config)#hostname R1

R1(config)#no ip domain-lookup

R1(config)#line console 0

R1(config-line)# logging synchronous

R1(config-line)#exec-timeout 0 0

R1(config-line)#exit

步驟二:接口配置

R1的配置:

R1(config)#interface s0

R1(config-if)#ip address 30.1.1.1 255.255.255.0

R1(config-if)#clock rate 64000 時鐘速率端

R1(config-if)#no shutdown

R1(config-if)#interface loopback 0

R1(config-if)#ip address 10.1.1.1 255.255.255.0

R1(config-if)#

R2的配置:

Router(config)#hostname R2

R2(config)#interface s1

R2(config-if)#ip address 30.1.1.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#interface loopback 0

R2(config-if)#ip address 20.1.1.1 255.255.255.0

R2(config-if)#exit

R2(config)#

步驟三、指定靜態路由

R1(config)#

R1(config)#ip route 20.1.1.0 255.255.255.0 serial 0 指定靜態路由

R2(config)#

R2(config)#ip route 10.1.1.0 255.255.255.0 30.1.1.1 指定靜態路由

步驟四、作ping 測試

R1#ping

Protocol [ip]:

Target IP address: 20.1.1.1 目的地址

Extended commands [n]: y 是否用擴展命令

Source address or interface: 10.1.1.1 源地址

!!!!! 顯示已通

步驟五、顯示靜態路由條目

R1#show ip route

Codes: C - connected, S - static, I - IGRP, 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, E - EGP

i - IS-IS, 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

20.0.0.0/24 is subnetted, 1 subnets

S 20.1.1.0 is directly connected, Serial0 靜態路由條目

10.0.0.0/24 is subnetted, 1 subnets

C 10.1.1.0 is directly connected, Loopback0

30.0.0.0/24 is subnetted, 1 subnets

C 30.1.1.0 is directly connected, Serial0

 

步驟六、顯示當前配置

R1的配置結果:

R1#show running-config

!

hostname R1

!

no ip domain-lookup

!

interface Loopback0

ip address 10.1.1.1 255.255.255.0

!

interface Serial0

ip address 30.1.1.1 255.255.255.0

clockrate 64000

!

ip route 20.1.1.0 255.255.255.0 Serial0

!

line con 0

exec-timeout 0 0

logging synchronous

transport input none

end

R2的配置結果:

R2#show running-config

!

hostname R2

!

no ip domain-lookup

!

interface Loopback0

ip address 20.1.1.1 255.255.255.0

!

interface Serial1

ip address 30.1.1.2 255.255.255.0

!

ip route 10.1.1.0 255.255.255.0 30.1.1.1

!

line con 0

exec-timeout 0 0

logging synchronous

!

end

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章