您好,欢迎来到宝玛科技网。
搜索
您的当前位置:首页实战分享:思科路由器高级配置,助力企业网络高效运行

实战分享:思科路由器高级配置,助力企业网络高效运行

来源:宝玛科技网

大家好,这里是G-LAB IT实验室。今天带领大家学习思科路由器高级配置,可以点赞收藏!

路由基本配置

配置静态路由

RIP 动态路由

OSPF 动态路由

实战:配置RIP企业环境

路由基本配置

路由器与交换机不同,交换机不需要配置也可以正常工作,但是路由器必须经过配置后才可以正常使用,路由器的登陆方式基本和交换机保持一致,下面将用一个实例实现路由器的基本配置,包括配置路由器的主机名称,密码,控制台端口,WAN接口和LAN接口等,来实现一个基本的路由结构.

首先我们准备两台路由器(1841型号),需要注意的是设备之间的连接所选用的线路类型,一般情况下路由器和PC之间使用交叉线,两台路由器相连接使用串行线,配置成以下拓扑结构即可:

但在实际连接两个路由器时,发现没有Serial接口,这是因为该型号的路由器默认没有提供串口,我们可以在思科模拟器上选择WIC-2T模块,并将其拖入空的插槽处,重启交换机即可完成配置.

[设备名称]   [设备接口]         [IP地址]           [默认网关]

   PC1         ---          192.168.1.2/24      192.168.1.1

   PC2         ---          192.168.2.2/24      192.168.2.1




 Router0      Fa0/0         192.168.1.1/24         ---

              Serial0/0/0   10.10.10.10/24         ---




 Router1      Fa0/0         192.168.2.1/24         ---

              Serial0/0/0   10.10.10.20/24         ---

开启路由远程登陆: 这里我们将启用Router1路由器的远程登陆功能,并设置一个登陆密码为lyshark.

Router# enable

Router# configure terminal




Router(config)# hostname Router0             // 配置主机名为Router0

Router0(config)# enable secret lyshark       // 配置模式密码为lyshark




Router0(config)# line console 0              // 启用控制台

Router0(config-line)# password lyshark       // 设置控制台登录密码

Router0(config-line)# login                  // 允许用户登录

Router0(config-line)# exit




Router0(config)# line vty 0 2                // 配置序号为0-2的3个虚拟登陆终端

Router0(config-line)# password lyshark       // 配置终端登录密码

Router0(config-line)# login                  // 启用登陆终端

配置WAN接口: 路由器通过WAN接口接入到互联网上,而常见的WAN接口都是串行接口用Serial表示,首先可以使用show controller命令判断Serial0/0/0是否为DCE端,然后决定是否要配置.

Router0> show controller Serial0/0/0




Interface Serial0/0/0

Hardware is PowerQUICC MPC860

DCE V.35, clock rate 2000000       // 此处判断是DEC端

根据上述标注显示内容Srial0/0/0为DCE端口,下面需要对两台路由分别配置时钟频率.

#----在Router0上操作-------------------------

Router0> enable

Router0# configure terminal

Router0(config)# interface Serial0/0/0                    // 选择串行接口Srial0/0/0

Router0(config-if)# ip address 10.10.10.10 255.255.255.0  // 配置IP地址

Router0(config-if)# clock rate 000                      // 配置始终频率为00

Router0(config-if)# no shutdown                           // 开启端口




#----在Router1上操作-------------------------

Router1> enable

Router1# configure terminal

Router1(config)# interface Serial0/0/0

Router1(config-if)# ip address 10.10.10.20 255.255.255.0

Router1(config-if)# clock rate 000

Router1(config-if)# no shutdown
#----在Router0上操作-------------------------

Router0> enable

Router0# configure terminal

Router0(config)# interface fa0/0                        // 选择以太网接口fa0/0

Router0(config)# ip address 192.168.1.1 255.255.255.0

Router0(config)# no shutdown




#----在Router1上操作-------------------------

Router1> enable

Router1# configure terminal

Router1(config)# interface fa0/0

Router1(config)# ip address 192.168.2.1 255.255.255.0

Router1(config)# no shutdown

查配置信息: 最后可以使用show ip route命令,查看路由器的路由信息,确定网络是否正确连接.

Router0# 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




     10.0.0.0/24 is subnetted, 1 subnets

C    10.10.10.0 is directly connected, Serial0/0/0            // 地址

C    192.168.1.0/24 is directly connected, FastEthernet0/0    // 内网地址

查接口信息: 也可以使用show ip interface brief命令,查看路由器的接口信息.

Router0# show ip interface brief




Interface              IP-Address      OK? Method Status                Protocol 

FastEthernet0/0        192.168.1.1     YES manual up                    up

Serial0/0/0            10.10.10.10     YES manual up                    up

Serial0/0/1            unassigned      YES unset  administratively down down

Vlan1                  unassigned      YES unset  administratively down down

最后测试通信: 在路由器Route0上可以ping通Route1,每个主机也可以ping通自己网段的路由器.

Router0# ping 10.10.10.20




Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/6 ms

上述小实验到这里就算配置成功了,但是这里留下了一个疑问,那就是PC0PingPC1无法通信,这就涉及到路由器没有相应的路由条目的问题,这些问题将在后面小实验中做解释.

配置静态路由

一般情况下以下几种情况可以考虑使用静态路由
1.网络的拓扑结构相对较简单,比如就一台路由器和交换机的情况,可使用静态路由.
2.网络保密性要求较高,网络管理员需要控制链路或者控制路由表,则可使用静态路由.
3.网络仅通过单个ISP接入Internet,则该ISP就是网络唯一的出口,所以不需要配置静态路由.
4.路由资源有限,无法运行路由选择协议,在这种情况下,需要手动配置路由条目来更新路由表数据.

接下来以一个实例具体介绍静态路由的配置流程,在思科模拟器中选择2台1841路由器,按照以下网络拓扑结构构建网路,然后为每台路由器配置静态路由,实现不同网络间的数据互通.

[设备名称]   [设备接口]         [IP地址]           [默认网关]

   PC0         ---          192.168.1.2/24      192.168.1.1

   PC1         ---          192.168.1.3/24      192.168.1.1




   PC2         ---          192.168.2.2/24      192.168.2.1

   PC3         ---          192.168.2.3/24      192.168.2.1




 Router0      Fa0/0         192.168.1.1/24         ---

              Serial0/0/0   10.10.10.10/24         ---




 Router1      Fa0/0         192.168.2.1/24         ---

              Serial0/0/0   10.10.10.20/24         ---
#----在Router0上操作-------------------------

Router0> enable

Router0# configure terminal




Router0(config)# interface fa0/0                          // 配置内网地址

Router0(config-if)# ip address 192.168.1.1 255.255.255.0

Router0(config-if)# no shutdown




Router0(config)# interface serial0/0/0                    // 配置地址

Router0(config-if)# clock rate 000

Router0(config-if)# ip address 10.10.10.10 255.255.255.0

Router0(config-if)# no shutdown




#----在Router1上操作-------------------------

Router0> enable

Router0# configure terminal




Router1(config)# interface fa0/0                          // 配置内网地址

Router1(config-if)# ip address 192.168.2.1 255.255.255.0

Router1(config-if)# no shutdown




Router1(config)# interface serial0/0/0                    // 配置地址

Router1(config-if)# clock rate 000

Router1(config-if)# ip address 10.10.10.20 255.255.255.0

Router1(config-if)# no shutdown

检测路由配置: 当配置好上面的步骤以后,PC0与PC1主机是可通信的,Route0与Route1也可通信,但PC0无法与PC3通信,原因就是因为路由器没有配置静态路由的关系,这一步我们只需要确保同一个网段内能通信即可.

#----在PC0上操作-------------------------

PC0> ping 192.168.1.1

PC0> ping 192.168.1.2

PC0> ping 192.168.1.3

Pinging 192.168.1.3 with 32 bytes of data:

Reply from 192.168.1.3: bytes=32 time=0ms TTL=128




#----在Route0上操作----------------------

Router0#ping 10.10.10.20




Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/7/12 ms

配置静态路由: 接下来我们需要在两台路由器上分别配置路由条目,使用ip route命令配置,如果想要删除路由可使用no ip route命令即可删除指定路由条目.

#----在Router0上操作-------------------------

Router0> enable

Router0# configure terminal




                           [目的网络]    [目的掩码]         [下一跳地址]

Router0(config)# ip route 192.168.2.0  255.255.255.0      10.10.10.20




#----在Router1上操作-------------------------

Router1> enable

Router1# configure terminal

Router1(config)# ip route 192.168.1.0 255.255.255.0 10.10.10.10        // 指定返回时的路由




#----检查配置参数情况-------------------------

Router0# show ip interface brief          // 显示端口ip

Router0# 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

     10.0.0.0/24 is subnetted, 1 subnets

C    10.10.10.0 is directly connected, Serial0/0/0

C    192.168.1.0/24 is directly connected,FastEthernet0/0

S    192.168.2.0/24 [1/0] via 10.10.10.20

最后的测试: 当配置好路由条目以后,我们在PC0主机上Ping检测PC3的连通性,会发现原来无法连通的两个网段,现在可以正常通信了,也就说明我们的路由配置生效了.

PC0> ping 192.168.2.2




Pinging 192.168.2.2 with 32 bytes of data:




Reply from 192.168.2.2: bytes=32 time=12ms TTL=126




Ping statistics for 192.168.2.2:

    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

    Minimum = 12ms, Maximum = 12ms, Average = 12ms

以上的路由配置方法,适用于小型网络环境,在大型网络环境中这种静态路由的配置方式很不适合维护,一旦设备过多,则可能自己都搞不清头绪,所以在生产环境中,我们会使用动态路由的方式来实现路由器的配置,接下来继续学习动态路由的配置方式吧.

RIP 动态路由

动态路由是基于某种协议实现的,常见的路由协议有内内部网关协议(IGP)和边界网关协议(BGP),其中内部网关协议又分为路由信息协议(RIP)和开放式最短路径优先协议(OSPF)协议.

RIP协议默认会每隔30秒就会与其他相连的网络广播自己的路由表,收到广播的路由器会将收到的信息与自己路由表进行比较,判断是否将其中的路由条目加入到自己的路由表中,目前RIP共有3中版本,RIPv1,RIPv2,RIPng,其中RIPng应用于IPv6网络环境中,RIPv1是有类路由协议,RIPv2则是无类路由协议.

[设备名称]     [设备接口]        [IP地址]          [默认网关]




 Router1     Serial0/0/0    192.168.10.1/24         ---




 Router2     Serial0/0/0    192.168.10.2/24         ---

             Serial0/0/1    192.168.20.1/24         ---




 Router3     Serial0/0/0    192.168.20.2/24         ---

             Serial0/0/1    192.168.30.1/24         ---




 Router4     Serial0/0/0    192.168.30.2/24         ---
Router>enable

Router#configure terminal




#----在Router1上操作-------------------------

Router1(config)# interface Serial0/0/0

Router1(config-if)# ip address 192.168.10.1 255.255.255.0

Router1(config-if)# no shutdown




#----在Router2上操作-------------------------

Router2(config)# interface Serial0/0/0

Router2(config-if)# ip address 192.168.10.2 255.255.255.0

Router1(config-if)# no shutdown

Router2(config)# interface Serial0/0/1

Router2(config-if)# ip address 192.168.20.1 255.255.255.0

Router1(config-if)# no shutdown




#----在Router3上操作-------------------------

Router3(config)# interface Serial0/0/0

Router3(config-if)# ip address 192.168.20.2 255.255.255.0

Router1(config-if)# no shutdown

Router3(config)# interface Serial0/0/1

Router3(config-if)# ip address 192.168.30.1 255.255.255.0

Router1(config-if)# no shutdown




#----在Router4上操作-------------------------

Router4(config)#interface Serial0/0/0

Router4(config-if)#ip address 192.168.30.2 255.255.255.0

Router1(config-if)# no shutdown

配置并启用RIP路由: 在每台路由器上启用并配置好RIP动态路由.

Router>enable

Router#configure terminal

#----在Router1上启用RIP路由协议并配置-------------------

Router1(config)# router rip                   // 启用RIP路由

Router1(config-router)# version 2             // 指定使用RIP版本为RIPv2

Router1(config-router)# network 192.168.10.0  // 声明与Router1直连的网络号

Router1(config-router)# exit




#----在Router2上启用RIP路由协议并配置-------------------

Router2(config)# router rip

Router2(config-router)# version 2

Router2(config-router)# network 192.168.10.0  // 声明与Router2直连的网络号

Router2(config-router)# network 192.168.20.0  // 声明与Router3直连的网络号

Router2(config-router)# exit




#----在Router3上启用RIP路由协议并配置-------------------

Router3(config)# router rip

Router3(config-router)# version 2

Router3(config-router)# network 192.168.20.0  // 声明与Router3直连的网络号

Router3(config-router)# network 192.168.30.0  // 声明与Router4直连的网络号

Router3(config-router)# exit




#----在Router4上启用RIP路由协议并配置-------------------

Router4(config)# router rip

Router4(config-router)# version 2

Router4(config-router)# network 192.168.30.0  // 声明与Router4直连的网络号

Router4(config-router)# exit

检查配置信息: 配置完成后,在Router1上执行show ip route 命令查看RIP配置结果,如下.

Router1#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




C    192.168.10.0/24 is directly connected, Serial0/0/0

R    192.168.20.0/24 [120/1] via 192.168.10.2, 00:00:01, Serial0/0/0   // R表示当前是RIP路由

R    192.168.30.0/24 [120/2] via 192.168.10.2, 00:00:01, Serial0/0/0   // 路由条目是RIP自动生成的

测试连通性: 此时我们在Router1路由器上Ping路由器Router4是可以通信的,说明配置成功了.

Router1#ping 192.168.30.2




Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 3/15/27 ms

OSPF 动态路由

在上面的配置试验中我们通过使用RIP协议完成了一个路由器之间的数据通信,但是RIP协议最大仅仅支持15个路由节点,虽然在中小型网络中这些节点足够使用了,但是在一些大型企业中往往需更多的跳数,就是因为这种需求我们的OSPF协议就由此诞生啦.

OSPF(开放式最短路径优先),该协议是基于链路状态的协议规范,因此也可以称为链路状态协议,和RIP协议相同,OSPF协议同样使用跳数计量路径开销,但是与RIP不同的是,OSPF协议不受物理跳数的,其路径开销与网络中的链路开销等相关.

OSPF协议采用了FPS算法来计算最短路径数,SPF算法将每一个路由作为根(ROOT),来计算其数据包到达每一个目标路由器之间的距离,每个路由器根据一个统一的数据库LSDB计算出路由域的拓扑结构图,该结构很像是一颗树,所以就叫做最短路径树.

OSPF协议的优点
1.OSPF采用了SPF算法,从而可以很好的避免路由器环路的产生.
2.OSPF协议虽然也使用跳数作为计量单位,但不受物理跳数的.
3.当网络链路状态发生变化时,OSPF能够迅速捕捉并应用,收敛快,路由信息流量小.
4.OSPF路由协议支持路由认证体系,且还可以定义不同的认证方式,提高了网络安全性.
5.OSPF协议提供了较好的负载均衡性,其数据更新比较智能,相应的减小了网络流量的带宽.

配置路由器: 首先更具上表的结构配置好路由器的各种参数.

Router>enable

Router#configure terminal


#----在Router1上操作-------------------------

Router1(config)# interface Serial0/0/0

Router1(config-if)# ip address 192.168.10.1 255.255.255.0

Router1(config-if)# no shutdown



#----在Router2上操作-------------------------

Router2(config)# interface Serial0/0/0

Router2(config-if)# ip address 192.168.10.2 255.255.255.0

Router1(config-if)# no shutdown

Router2(config)# interface Serial0/0/1

Router2(config-if)# ip address 192.168.20.1 255.255.255.0

Router1(config-if)# no shutdown




#----在Router3上操作-------------------------

Router3(config)# interface Serial0/0/0

Router3(config-if)# ip address 192.168.20.2 255.255.255.0

Router1(config-if)# no shutdown

Router3(config)# interface Serial0/0/1

Router3(config-if)# ip address 192.168.30.1 255.255.255.0

Router1(config-if)# no shutdown




#----在Router4上操作-------------------------

Router4(config)# interface Serial0/0/0

Router4(config-if)# ip address 192.168.30.2 255.255.255.0

Router1(config-if)# no shutdown

配置并启用OSPF路由: 在每台路由器上启用并配置好OSPF动态路由.

Router>enable

Router#configure terminal




#----在Router1上启用OSPF路由协议并配置-------------------

Router1(config)# router ospf 1                                 // 启用OSPF路由,并设置进程号为1

Router1(config-router)# router-id 1.1.1.1                      // 为Router1配置RID编号

Router1(config-router)# network 192.168.10.0 0.0.0.255 area 0  // 配置路由记录

Router1(config-router)# exit




#----在Router2上启用OSPF路由协议并配置-------------------

Router2(config)# router ospf 1                                 // 启用OSPF路由,并设置进程号为1

Router2(config-router)# router-id 2.2.2.2                      // 为Router2配置RID编号

Router2(config-router)# network 192.168.10.0 0.0.0.255 area 0  // 配置路由记录

Router2(config-router)# network 192.168.20.0 0.0.0.255 area 0

Router2(config-router)# exit




#----在Router3上启用OSPF路由协议并配置-------------------

Router3(config)# router ospf 1                                 // 启用OSPF路由,并设置进程号为1

Router3(config-router)# router-id 3.3.3.3                      // 为Router3配置RID编号

Router3(config-router)# network 192.168.20.0 0.0.0.255 area 0

Router3(config-router)# network 192.168.30.0 0.0.0.255 area 0

Router3(config-router)# exit




#----在Router4上启用OSPF路由协议并配置-------------------

Router3(config)# router ospf 1                                 // 启用OSPF路由,并设置进程号为1

Router3(config-router)# router-id 4.4.4.4                      // 为Router4配置RID编号

Router3(config-router)# network 192.168.30.0 0.0.0.255 area 0

Router3(config-router)# exit

检查配置信息: 配置完成后,在Router1上执行show ip route 命令查看OSPF配置结果,如下.

Router#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




C    192.168.10.0/24 is directly connected, Serial0/0/0                    // C表示是本机默认路由

O    192.168.20.0/24 [110/128] via 192.168.10.2, 00:02:25, Serial0/0/0     // O表示当前是OSPF路由

O    192.168.30.0/24 [110/192] via 192.168.10.2, 00:01:55, Serial0/0/0     // 路由条目是OSPF自动生成的

测试连通性: 此时我们在Router1路由器上Ping路由器Router4是可以通信的,说明配置成功了.

Router1#ping 192.168.30.2




Type escape sequence to abort.

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

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 3/15/27 ms

实战:配置RIP企业环境

接下来,我们通过使用三层交换机配合路由器,来实现一个跨网段通信的案例,其配置流程是,首先配置三层交换机并划分好VLAN的层次,接着在配置Router0这里不需要配置VLAN,原因是三层交换机与Router0共享VLAN,最后在配置口的Router1路由器,其拓扑结构如下图所示:

配置三层交换: 首先先来配置三层交换机,创建3个VLAN,并划分成三个VLAN虚拟局域网.

Switch> enable

Switch# configure terminal




#----配置三层交换的VLAN10并把端口fa0/1加入到VLAN-------------------

Switch(config)# vlan 10                              // 创建VLAN10

Switch(config-vlan)# interface fa0/1                 // 将Fa1俩端口加入到VLAN10

Switch(config-if-range)# switchport mode access

Switch(config-if-range)# switchport access vlan 10   // 把端口加入到VLAN10

Switch(config-if-range)# no shutdown                 // 启用端口

Switch(config-if-range)# exit




#----配置三层交换的VLAN20并把端口fa0/2加入到VLAN-------------------

Switch(config)# vlan 20

Switch(config-vlan)# interface fa0/2

Switch(config-if-range)# switchport mode access

Switch(config-if-range)# switchport access vlan 20

Switch(config-if-range)# no shutdown

Switch(config-if-range)# exit




#----配置三层交换的VLAN30并把端口fa0/3加入到VLAN-------------------

Switch(config)# vlan 30

Switch(config-vlan)# interface fa0/3

Switch(config-if)# switchport mode access

Switch(config-if)# switchport access vlan 30

Switch(config-if)# no shutdown

Switch(config-if)# exit
Switch> enable

Switch# configure terminal




#----给三层交换的VLAN10内的主机添加网关-------------------

Switch(config)# interface vlan 10                            // 选择vlan10接口

Switch(config-if)# ip address 192.168.1.1 255.255.255.0      // 配置网关地址

Switch(config-if)# no shutdown                               // 开启端口

Switch(config-if)# exit




#----给三层交换的VLAN20内的主机添加网关-------------------

Switch(config)# interface vlan 20                            // 选择vlan20接口

Switch(config-if)# ip address 192.168.2.1 255.255.255.0      // 配置网关地址

Switch(config-if)# no shutdown                               // 开启端口

Switch(config-if)# exit




#----给三层交换的VLAN30内的主机添加网关-------------------

Switch(config)# interface vlan 30                            // 选择vlan30接口

Switch(config-if)# ip address 192.168.3.1 255.255.255.0      // 配置网关地址

Switch(config-if)# no shutdown                               // 开启端口

Switch(config-if)# exit
Router> enable

Router# configure terminal




#----配置路由fa0/0端口的IP地址-------------------

Router0(config)# interface fa0/0

Router0(config-if)# ip address 192.168.3.2 255.255.255.0

Router0(config-if)# no shutdown

Router0(config-if)# exit




#----配置路由fa0/1端口的IP地址-------------------

Router0(config)# interface fa0/1

Router0(config-if)# ip address 192.168.4.1 255.255.255.0

Router0(config-if)# no shutdown

Router0(config-if)# exit




#----配置路由se0/0/0连接端口IP----------------

Router0(config)# interface se0/0/0

Router0(config-if)# ip address 1.1.1.1 255.0.0.0

Router0(config-if)# no shutdown

Router0(config-if)# exit
Router> enable

Router# configure terminal




#----配置路由器1的内网口地址-------------------

Router1(config)# interface se0/0/0

Router1(config-if)# ip address 1.1.1.2 255.0.0.0

Router1(config-if)# no shutdown

Router1(config-if)# exit




#----配置路由器1的口地址-------------------

Router1(config)# interface fa0/0

Router1(config-if)# ip address 10.10.10.10 255.0.0.0

Router1(config-if)# no shutdown
Switch(config)# ip routing

Switch(config)# router rip




Switch(config-router)# network 192.168.1.0

Switch(config-router)# network 192.168.2.0

Switch(config-router)# network 192.168.3.0

Switch(config-router)# network 192.168.4.0

配置二层路由器RIP: 最后还需要分别配置两个路由器并开启其路由功能.

#----配置路由器Router0-------------------

Router0(config)# router rip

Router0(config-router)# network 192.168.3.0

Router0(config-router)# network 192.168.4.0




#----配置路由器Router1-------------------

Router1(config)# route rip

Router1(config-router)# network 192.168.3.0

Router1(config-router)# network 192.168.4.0

Router1(config-router)# network 192.168.4.0

Router1(config-router)# network 1.1.1.1

以上配置流程就是全部的实验配置过程,在配置完成功能后,我们首先通过使用ping命令来测试内部主机是否能够Ping通,最后的实验结果是,内网主机均可以实现通信,主机无法和内网主机通信.

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- baomayou.com 版权所有 赣ICP备2024042794号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务