实验目的:
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#hostname r1
r1(config)#in s1/0
r1(config-if)#ip add 219.146.0.1 255.255.255.0
r1(config-if)#no shut
r1(config-if)#in s1/1
r1(config-if)#ip add 219.146.1.1 255.255.255.0
r1(config-if)#no shut
r1(config-if)#exi
r1(config)#ip route 219.146.2.0 255.255.255.0 219.146.0.2 //配置一条静态路由
r1(config)#ip route 219.146.3.0 255.255.255.0 serial 1/0 //下一跳也可以是接口,这样管理距离就是0了
r2基本配置:
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#hostname r2
r2(config)#in s1/0
r2(config-if)#ip add 219.146.2.1 255.255.255.0
r2(config-if)#no shut
r2(config)#in s1/1
r2(config-if)#ip add 219.146.1.2 255.255.255.0
r2(config-if)#no shut
r2(config-if)#exi
r2(config)#ip route 219.146.0.0 255.255.255.0 219.146.2.2 20 //20为手工指定的管理距离
r2(config)#ip route 219.146.3.0 255.255.255.0 219.146.2.2 20 //手工指定管理距离后,就变成浮动静态路由了,在ipv4里浮动路由不能跟接口,只能跟下一跳地址,在ipv6里可以是跟接口
r3基本配置:
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#hostname r3
r3(config)#in s1/0
r3(config-if)#ip add 219.146.0.2 255.255.255.0
r3(config-if)#no shut
r3(config-if)#in s1/1
r3(config-if)#ip add 219.146.2.2 255.255.255.0
r3(config-if)#no shut
r3(config-if)#in s1/2
r3(config-if)#ip add 219.146.3.1 255.255.255.0
r3(config-if)#no shut
r3(config-if)#exi
r3(config)#ip route 219.146.1.0 255.255.255.0 serial 1/0
r3(config)#ip route 219.146.1.0 255.255.255.0 serial 1/1 //这样到达219.146.1.0网络就有两条路可走,实现了冗余
r3(config)#do 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
C 219.146.3.0/24 is directly connected, Serial1/2
C 219.146.0.0/24 is directly connected, Serial1/0
S 219.146.1.0/24 is directly connected, Serial1/0
is directly connected, Serial1/1
Router>en
Router#conf t
Router(config)#enable secret abc
Router(config)#line console 0
Router(config-line)#password abc
Router(config-line)#login
Router(config-line)#logging synchronous
Router(config-line)#exec-timeout 0 0
Router(config-line)#exi
Router(config)#no ip domain lookup
Router(config)#hostname r4
r4(config)#in s1/0
r4(config-if)#ip add 219.146.3.2 255.255.255.0
r4(config-if)#no shut
r4(config-if)#exi
r4(config)#ip route 219.146.0.0 255.255.255.0 serial 1/0 //添加静态路由表
r4(config)#ip route 219.146.1.0 255.255.255.0 serial 1/0
r4(config)#ip route 219.146.2.0 255.255.255.0 serial 1/0
默认路由配置:
r4(config)#ip route 0.0.0.0 0.0.0.0 serial 1/0 //添加默认路由