企业网络搭建与应用——项目三 路由器的配置与管理

任务一 使用路由器的命令行界面

       路由器令行界面有多种模式,常用的命令模式如表所示。每种命令模式下可配置路由器的不同组件。在命令行界面中输入问号“?”可以在每种命令模式下显示可用的命令列表,当前可用的命令取决于所处的命令模式。

      如果您想撤销一个命令或恢复为缺省属性,可以在大多数命令前加关键字;

例如,no ip routing

下面是通过带外管理方式进入路由器命令行界面的具体操作。

步骤  关闭电源的情况下,用Console线的一端与计算机机的RS-232串口相连;另一端与路由器的Console口相连,然后开启路由器和计算机的电源 

步骤  在计算机上选择“桌面”>超级终端”选项,打开Windows系统自带超级终端。 

步骤3  单击“确定”按钮,系统弹出“COM1属性”对话框,如图所示。在“每秒位数”下拉列表中选择“9600”,在“数据位”下拉列表中选择“8”,在“奇偶校验”下拉列表中选择“无”,在“停止位”下拉列表中选择“1”,在“数据流控制”下拉列表中选择“无”,单击“确定”按钮 

步骤4  路由器加电,超级终端会显示路由器自检信息,自检结束后,按【Enter】键进入用户配置模式,如图所示。 

 

任务二 路由器的端口基本配置 

本任务的目的是通过带内管理方式为路由器的端口配置IP地址并开启端口,然后通过Telnet命令登录路由器,具体操作如下:

步骤1   设置路由器以太网接口f0/0IP地址,代码如下: 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#

具体执行代码如下图所示: 

 

 步骤2   设置计算机的IP地址

 

 步骤  使用Ping命令测试计算机与路由器的连通性

 

 步骤  通过telnet方式登录路由器。如果路由器已经被正确配置了以太网口的IP地址,并且设置了远程登陆所需要的用户名和密码,然后被连接到局域网,这时局域网用户可通过Telnet命令登录路由器,在计算机上打开命令窗口,然后执行操作命令“telnet 192.168.2.1”

 1)在路由器上设置远程登录密码为:cisco

Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line vty 0 4
Router(config-line)#lo
Router(config-line)#login
% Login disabled on line 194, until 'password' is set
% Login disabled on line 195, until 'password' is set
% Login disabled on line 196, until 'password' is set
% Login disabled on line 197, until 'password' is set
% Login disabled on line 198, until 'password' is set
Router(config-line)#password cisco
Router(config-line)#^Z
Router#

代码输入截图如下:

2)在PC端远程登录

任务三 路由器的静态路由配置

       信科公司刚成立不久,公司规模还小,内部网络只用了两台路由器和两台交换机。公司的两台路由器将内部网络划分为两个网段,现在想通过路由器的静态路由来使这两个网段互相访问,网络拓扑图如下图所示。

实现上述功能的操作如下: 

 步骤1     配置计算机IP地址,如图3-9和图3-10所示。

 

步骤2    配置路由器接口的IP地址,如表3-3所示。需保证所有接口全部是up状态并测试连通性 

配置Router0的代码如下: 

Router>en 
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#ex
Router(config)#int f0/1
Router(config-if)#ip add 192.168.3.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

Router(config-if)#ex
Router(config)#

配置Router1的代码具体截图如下: 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#no shu

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#ex
Router(config)#int f0/1
Router(config-if)#ip add 192.168.3.2 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Router(config-if)#ex
Router(config)#

 步骤3    路由器1设置静态跳转,若遇到访问PC1(也就是192.168.1.1)网段的数据包,将其往路由器0的0/1端口(也就是192.168.3.1)跳转,再通过跳转后到达的路由查询路由表中PC1(也就是192.168.1.1)网段再转发数据包。代码如下:

Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1
Router(config)#

 步骤  路由器0也设置一个跳转,否则数据发送出去之后,找不到回来的路,那么就无法返回信息了。代码如下:

 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.2
Router(config)#

 步骤  设置在计算机PC1Ping计算机PC2,测试全网是否连通了,如图3-11所示。

 

图3-11 

 任务四 路由器的RIP动态路由设置

随着信科公司规模的扩大,公司想对企业网络进行升级改造,在规划网络时,网络管理人员发现改造后的网络中路由器较多,手工配置静态路由会带来很大的工作负担,因此想使用动态路由协议。由于RIP协议配置简单,当网络出现问题时容易排除故障,因此网管决定采用RIP协议配置动态路由,网络拓扑图如图3-12所示。

 3-12 

配置路由器的RIP动态路由的具体操作如下:

步骤1    配置路由器相关接口的IP地址,如表3-4所示。

 ​​​​​​​

 配置Router0的代码如下:

 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int s0/0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#cl
Router(config-if)#clock ra
Router(config-if)#clock rate 64000
Router(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Router(config-if)#ex
Router(config)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

Router(config)#int f0/0
Router(config-if)#ip add 192.168.0.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#ex

 配置Router1的代码如下:

 ​​​​​​​

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int s0/0/0
Router(config-if)#ip add 192.168.1.2 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

Router(config-if)#ex
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

Router(config)#int s0/0/1
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#cl
Router(config-if)#clock ra
Router(config-if)#clock rate 64000
Router(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
Router(config-if)#ex
Router(config)#

配置Router2的代码如下: 

 ​​​​​​​

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int s0/0/1
Router(config-if)#ip add 192.168.2.2 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/1, changed state to up

Router(config-if)#ex
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to up

Router(config)#int f0/0
Router(config-if)#ip add 192.168.3.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#ex

步骤  配置计算机的IP地址,如图3-13和图3-14所示。

 

 步骤  路由器0上配置RIP,代码如下:

 ​​​​​​​

Router#en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 192.168.0.0
Router(config-router)#network 192.168.1.0
Router(config-router)#ex
Router(config)#

 步骤  在路由器1上配置RIP,代码如下:

 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 192.168.1.0
Router(config-router)#network 192.168.2.0
Router(config-router)#ex
Router(config)#

步骤  在路由器2上配置RIP,代码如下: 

 

Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 192.168.2.0
Router(config-router)#network 192.168.3.0
Router(config-router)#ex
Router(config)#

  

步骤  计算机PC1Ping计算机PC2,测试全网是否连通了,如图3-15所示

任务五 路由器的OSPF动态路由配置

信科公司规模越来越大,路由器也越来越多,其中公司总部路由器连接有服务器子网,为了实现路由的快速收敛,公司网管计划在网络中使用OSPF路由协议,网络结构如图3-16所示。 

 

 

注:上图为时钟线的连线方法。

配置路由器OSPF动态路由的具体操作如下: 

步骤  配置路由器相关接口的IP地址,如表3-5所示。 

配置Router0的代码如下: 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#int s0/0/0
Router(config-if)#ip add 192.168.3.1 255.255.255.0
Router(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Router(config-if)#clock rate 64000
Router(config-if)#ex
Router(config)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

 

 配置Router1的代码如下:

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 192.168.2.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#ex
Router(config)#int s0/0/0
Router(config-if)#ip add 192.168.3.2 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

Router(config-if)#ex
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

 

 步骤  配置计算机的IP地址,如图3-17和图3-18所示。

步骤  在路由器0上配置OSPF,代码如下 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router ospf 1
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router(config-router)#ex
Router(config)#
00:37:04: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.3.2 on Serial0/0/0 from LOADING to FULL, Loading Done

步骤  在路由器1上配置OSPF,代码如下: 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#router ospf 1
Router(config-router)#network 192.168.2.0 0.0.0.255 area 0
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router(config-router)#ex
Router(config)#
00:36:01: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.3.1 on Serial0/0/0 from LOADING to FULL, Loading Done

 

步骤  在计算机PC1Ping计算机PC2,测试全网是否连通了,如图3-19所示。 

任务六 路由器的路由重分布配置 

       信科公司收购了一家公司,现在需要在两个公司之间建立起网络连接,但是由于两家公司所采用的网络协议不同,使得建立连接的工作出现困难。信科公司原来采用的网络协议为OSPF,而新收购的公司采用的路由协议为RIP。为了实现两个公司的网络连接,网络管理员决定采用RIPOSPF重分发的技术来解决问题,网络拓扑图如图3-20所示。 

 配置路由器路由重分布的具体操作如下:

步骤  配置路由器相关接口的IP地址,如上图所示。

 配置Router0的代码如下:

 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int f0/0
Router(config-if)#ip add 1.1.1.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

Router(config-if)#ex
Router(config)#int s0/0/0
Router(config-if)#ip add 192.168.12.1 255.255.255.0
Router(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/0/0, changed state to down
Router(config-if)#clock rate 64000
Router(config-if)#ex
Router(config)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up
%IP-4-DUPADDR: Duplicate address 1.1.1.1 on FastEthernet0/0, sourced by 0006.2AB8.1C6D

 配置Router2的代码如下:

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int s0/0/0
Router(config-if)#ip add 192.168.12.2 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

Router(config-if)#ex
Router(config)#int s0/0/1
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

Router(config-if)#ip add 192.168.23.2 255.255.255.0
Router(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/0/1, changed state to down
Router(config-if)#cl
Router(config-if)#clock ra
Router(config-if)#clock rate 64000
Router(config-if)#ex
Router(config)#
%LINK-5-CHANGED: Interface Serial0/0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1, changed state to up

配置Router2的代码如下: 

Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#int s0/0/0
Router(config-if)#ip add 192.168.23.3 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/0/0, changed state to up

Router(config-if)#ex
Router(config)#int f0/0
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0, changed state to up

Router(config-if)#ip add 3.3.3.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

 步骤2    Router0上配置RIP协议,代码如下:

Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#ne
Router(config-router)#network 192.168.12.0
Router(config-router)#network 1.1.1.0
Router(config-router)#ex
Router(config)#ex
Router#

步骤3   RouterB的s0/0/0接口配置RIP协议,在s0/0/1接口配置OSPF协议,代码如下 

Router(config)#router rip
Router(config-router)#version 2
Router(config-router)#network 192.168.12.0
Router(config-router)#ex
Router(config)#router ospf 1
Router(config-router)#network  192.168.23.0 0.0.0.255 area 0
Router(config-router)#ex
Router(config)#

 步骤4   Router2上配置OSPF协议,命令如下

Router(config-if)#ex
Router(config)#router ospf 1
Router(config-router)#ne
Router(config-router)#ne
Router(config-router)#net
Router(config-router)#network 192.168.23.0 0.0.0.255 area 0
Router(config-router)#
00:11:13: %OSPF-5-ADJCHG: Process 1, Nbr 192.168.23.2 on Serial0/0/0 from LOADING to FULL, Loading Done

Router(config-router)#network 3.3.3.0 0.0.0.255 area 0
Router(config-router)#ex
Router(config)#

 步骤5  Router0上查看路由表,可以看到路由表中信息无法学到。

 

步骤6   Router1上添加重发布路由,代码如下: 

 步骤7  RouterA上查看路由表,可以看到路由表中信息已经学到。

  • 2
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
大型企业网络拓扑配置包括以下步骤: 1. 配置VTP协议:将SW7和SW8配置为vtp server端,SW1,SW2,SW3,SW4,SW5,SW6,SW9配置为vtp client端,并创建一个域。在SW7上创建VLAN 10,VLAN 20,VLAN 30,VLAN 40,VLAN 50,并按照表2-1中的VLAN名称进行命名,实现vtp client端同步到SW7上的VLAN配置。 2. 划分部门PC到对应的VLAN中:根据拓扑图,将每个部门的PC划分到对应的VLAN中,并通过层交换机实现各部门PC之间的通信。可以使用ping命令进行测试。 3. 配置DHCP服务器:启用并配置DHCP服务器,为各部门的PC分配IP地址、子网掩码、默认网关、DNS服务器IP。 4. 配置FTP服务器:启用并配置FTP服务器,创建一个用户,各部门员工能够用该用户名和密码访问到FTP服务器。 5. 配置WEB服务器:启用并配置WEB服务器,编辑首页index.html,将标题的字体大小设置为10,标题的字体颜色设置为绿色,标题的名称改为"My Name is zhengjunsong!",各部门员工能够通过域名访问到该网页。 6. 配置DNS服务器:启用并配置DNS服务器,实现将www.zjs.com解析为WEB Server的IP地址3.66.3.2。 7. 配置OSPF路由协议:在层交换机SW7和SW8、路由器R1和ISP上启用OSPF路由协议,实现全网可达。 8. 获取协议数据包:获取网络中的UDP、TCP、DHCP、DNS、HTTP、FTP协议的数据包,并按要求截图。 以上是大型企业网络拓扑配置的一般步骤,具体的配置细节和命令可以根据实际情况进行调整和配置

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值