当前位置:文档之家› 路由器静态路由配置案例

路由器静态路由配置案例

路由器静态路由配置【案例背景】学校有新旧两个校区,每个校区是一个独立的局域网,为了使新旧校区能够正常相互通讯,共享资源。

每个校区出口利用一台路由器进行连接,两台路由器间学校申请了一条2M的DDN专线进行相连,要求你做适当配置实现两个校区间的正常相互访问。

【案例目的】掌握静态路由的配置方法和技巧,熟悉广域网线缆的连接方式。

【技术原理】路由器属于网络层设备,能够根据IP包头的信息,选择一条最佳路径,将数据包转发出去。

实现不同网段的主机之间的互相访问。

路由器是根据路由表进行选路和转发的。

而路由表里就是由一条条的路由信息组成。

路由表的产生方式一般有3种:直连路由给路由器接口配置一个IP地址,路由器自动产生本接口IP所在网段的路由信息。

静态路由在拓扑结构简单的网络中,网管员通过手工的方式配置本路由器未知网段的路由信息,从而实现不同网段之间的连接。

动态路由协议学习产生的路由在大规模的网络中,或网络拓扑相对复杂的情况下,通过在路由器上运行动态路由协议,路由器之间互相自动学习产生路由信息。

【案例内容】1、按照拓扑进行网络连接2、配置路由器的接口地址参数3、配置静态路由4、测试【实现功能】实现网络的互连互通,从而实现信息的共享和传递。

【案例设备】R1762(2台),PC(2台)、直连线(2条)、V.35线缆(1对)【案例拓扑】【主要命令】Ip route ,clock rate , no shutdown, ip address【案例步骤】1、在路由器 Router1 上配置接口的 IP 地址和串口上的时钟频率。

router#confrouter#host Router1Router1(config)# interface fastethernet 1/0 !进入接口fastethernet 1/0的配置模式 Router1(config-if)# ip address 192.168.1.1 255.255.255.0 !配置路由器接口fastethernet 1/0的 IP 地址Router1(config)# no shutdown !开启路由器 fastethernet0 接口 Router1(config)# interface serial 1/2 !进入接口 S1/2 配置模式 Router1(config-if)# ip address 192.168.2.1 255.255.255.0 !配置路由器接口 S1/2 的 IP 地址Router1(config-if)#clock rate 64000 !配置 Router1 的时钟频率(DCE ) Router1(config)# no shutdown !开启路由器serial 1/2接口 Router1(config)#end验证测试:验证路由器接口的配置Router1#show ip interface briefInterface IP-Address(Pri) OK? Status serial 1/2 192.168.2.1/24 YES UP serial 1/3 no address YES DOWN FastEthernet 1/0 192.168.1.1/24 YES UP FastEthernet 1/1 no address YES DOWN Null 0 no address YES UP Router1#show interface serial 1/2serial 1/2 is UP , line protocol is UPHardware is PQ2 SCC HDLC CONTROLLER serialInterface address is: 192.168.2.1/24MTU 1500 bytes, BW 2000 KbitEncapsulation protocol is HDLC, loopback not setKeepalive interval is 10 sec , setCarrier delay is 2 secRXload is 1 ,Txload is 1Queueing strategy: WFQ5 minutes input rate 15 bits/sec, 0 packets/sec5 minutes output rate 17 bits/sec, 0 packets/sec1030 packets input, 22660 bytes, 0 no bufferReceived 1030 broadcasts, 0 runts, 0 giants14 input errors, 1 CRC, 12 frame, 0 overrun, 1 abort1031 packets output, 22682 bytes, 0 underruns0 output errors, 0 collisions, 3 interface resets1 carrier transitionsV35 DCE cable F 1/0 N I C F 1/0 N I CS 1/2 S 1/2R o u t e r 1R o u t e r 2DCD=up DSR=up DTR=up RTS=up CTS=up2、在路由器Router1 上配置静态路由。

Router1#confRouter1(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2或:Router1(config)#ip route 192.168.3.0 255.255.255.0 serial 1/2验证测试:验证Router1 上的静态路由配置Router1#show ip routeCodes: C - connected, S - static, R - RIPO - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2* - candidate defaultGateway of last resort is no setC 172.16.1.0/24 is directly connected, FastEthernet 1/0C 172.16.1.1/32 is local host.C 172.16.2.0/24 is directly connected, serial 1/2C 172.16.2.1/32 is local host.S 172.16.3.0/24 [1/0] via 172.16.2.23、在路由器Router2 上配置接口的IP 地址和串口上的IP 地址。

router# confrouter# hostname Router2Router2(config)#Router2(config)# interface fastethernet 1/0!进入接口fastethernet 1/0 的配置模式Router2(config-if)# ip address 192.168.3.1 255.255.255.0 !配置路由器接口fastethernet 1/0的IP 地址Router2(config)# no shutdown !开启路由器fastethernet0 接口Router2(config)# interface serial 1/2 !进入接口S1/2 配置模式Router2(config-if)# ip address 192.168.2.2 255.255.255.0 !配置路由器接口S1/2 的IP 地址Router2(config)# no shutdown !开启路由器serial 1/2 接口Router2(config)#end验证测试:验证路由器接口的配置Router2#show ip interface briefInterface IP-Address(Pri) OK? Statusserial 1/2 192.168.2.2/24 YES UPserial 1/3 no address YES DOWNFastEthernet 1/0 192.168.3.1/24 YES UPFastEthernet 1/1 no address YES DOWNNull 0 no address YES UPRouter2#show interface serial 1/2serial 1/2 is UP , line protocol is UPHardware is PQ2 SCC HDLC CONTROLLER serialInterface address is: 192.168.2.2/24MTU 1500 bytes, BW 2000 KbitEncapsulation protocol is HDLC, loopback not setKeepalive interval is 10 sec , setCarrier delay is 2 secRXload is 1 ,Txload is 1Queueing strategy: WFQ5 minutes input rate 17 bits/sec, 0 packets/sec5 minutes output rate 17 bits/sec, 0 packets/sec1082 packets input, 23804 bytes, 0 res lack, 0 no buffer,0 droppedReceived 1082 broadcasts, 0 runts, 0 giants1 input errors, 0 CRC, 1 frame, 0 overrun, 0 abort1082 packets output, 23804 bytes, 0 underruns,0 dropped0 output errors, 0 collisions, 3 interface resets1 carrier transitionsV35 DTE cableDCD=up DSR=up DTR=up RTS=up CTS=up4、在路由器Router2 上配置静态路由。

Router2#confRouter2(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1或:Router2(config)#ip route 192.168.1.0 255.255.255.0 serial 1/2验证测试:验证Router2 上的静态路由配置Router2#show ip routeCodes: C - connected, S - static, R - RIPO - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2* - candidate defaultGateway of last resort is no setS 192.168.1.0/24 [1/0] via 192.168.2.1C 192.168.2.0/24 is directly connected, serial 1/2C 192.168.2.2/32 is local host.C 192.168.3.0/24 is directly connected, FastEthernet 1/0C 192.168.3.1/32 is local host.5、测试网络的互连互通性。

相关主题