CCNA-广域网互连实操配置指南

发布时间:2009-10-14 【

  某公司原有网络为两个孤立的局域网:主干网和用户网。网络规划设计图如下所示:

  

  上图中,左侧路由器名称:Central,Ethernet 0端口连接公司主干网络Central Network,并且连有一台PC机:PC A。路由器端口IP地址配置及PC A的IP地址配置如图所示。

  右侧路由器名称:ThinkTop,Ethernet 0端口连接着一个客户网络Client Network,并且连有一台PC机:PC B。路由器端口IP地址配置及PC B的IP地址配置如图所示。

  现公司希望申请一条专线,连接路由器Central的Serial 0端口和路由器ThinkTop的Serial 0端口,分配网络10.0.0.4/30作为广域网互联的网络,实现骨干网络和客户网络的互联互通,确保PC A和PC B之间相互通讯正常。

  

1、操作要求

  • 使用背靠背电缆连接两台路由器,确保Central路由器上所连线缆为DCE端;
  • 使用正确的双绞线连接路由器与PC机;
  • 配置两台路由器的名称,Ethernet和Serial端口的IP地址,并分别为每个端口加上描述语句,格式为“Connet_To_****”;
  • 配置两台路由器的广域网接口Serial 0,其中DCE端要求配置时钟为:64000,带宽为:64000bps,并确保联通;
  • 在两台路由器上配置静态路由,确保PC A和PC B之间可以互通;
  • 配置路由器,使得用户接入路由器的Console端口、Aux端口和Telnet时必须输入用户名和密码(用户名:test,密码:szptt);
  • 保存配置文件至路由器内;

2、配置指南

  • 首先,确保路由器物理连线正确,使用背靠背电缆连接两路由器Serial 0 端口;
  • 使用交叉电缆,连接路由器与PC机;
  • 打开 程序 -> 附件 -> 通讯 -> 超级终端;

  

  • 使用路由器配置电缆连接PC的COM1端口和路由器的控制台端口(在路由器背面端口上标记为console),在 新建连接 中输入连接的名称,按照如下图所示完成基本配置:

  

 

  

 

  

  单击确定,敲下回车键,即可进入配置界面。

  • 首先配置路由器Central:

  路由器加电后,在控制台上可以看到如下消息输出:

System Bootstrap, Version 11.0(10c), SOFTWARE
Copyright (c) 1986-1996 by cisco Systems
2500 processor with 2048 Kbytes of main memory

Notice: NVRAM invalid, possibly due to write erase.

F3: 5653052+80216+423844 at 0x3000060

Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706



Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-I-L), Version 12.0(12), RELEASE SOFTWARE (fc1) //路由器操作系统的版本,v12.0(12)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Tue 11-Jul-00 07:51 by htseng
Image text-base: 0x0302F400, data-base: 0x00001000

cisco 2500 (68030) processor (revision N) with 2048K/2048K bytes of memory.
Processor board ID 11141310, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
32K bytes of non-volatile configuration memory.
8192K bytes of processor board System flash (Read ONLY) //路由器FLASH存储器的大小

  如果一个路由器没有配置文件存在,那么系统启动后会弹出如下提醒:

--- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: //是否需要进入初始配置对话?

  一般情况下,我们都会输入 NO,选择不进入初始配置对话,以便在标准配置模式下完成设备配置。

--- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: no
Would you like to terminate autoinstall? [yes]:Yes
Press RETURN to get started! //敲下回车键,进入设备配置界面

00:00:21: %LINK-3-UPDOWN: Interface Ethernet0, changed state to up
00:00:21: %LINK-3-UPDOWN: Interface Serial0, changed state to up
00:00:21: %LINK-3-UPDOWN: Interface Serial1, changed state to down
00:00:22: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to up
00:00:22: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up
00:00:22: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to down
00:00:44: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down
00:00:45: %LINK-5-CHANGED: Interface Serial0, changed state to administratively down
00:00:45: %LINK-5-CHANGED: Interface Ethernet0, changed state to administratively down
00:00:45: %LINK-5-CHANGED: Interface Serial1, changed state to administratively down
00:00:46: %IP-5-WEBINST_KILL: Terminating DNS process
00:00:46: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to down
00:00:47: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-I-L), Version 12.0(12), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Tue 11-Jul-00 07:51 by htseng
Router>
Router> //本提示符,> ,意味着进入了路由器操作系统的用户模式,即最基本的用户界面。

  如要进行设备的配置动作,必须进入特权模式。使用 enalbe 和 disable 命令在用户模式和特权模式之间切换:

Router>enable //进入特权模式
Router# //本提示符,#,意味着进入了路由器操作系统的特权模式。
Router#disable //返回用户模式
Router>

  下面,确认系统的基本信息:

Router#show ip interface brief //查看Central路由器上的所有端口

Interface IP-Address OK? Method Status Protocol
Ethernet0 unassigned YES unset administratively down down
Serial0 unassigned YES unset administratively down down
Serial1 unassigned YES unset administratively down down

  //系统上有三个接口:一个以太网端口:Ethernet 0,两个串口:Serial 0和Serial 1

Router#show controllers serial 0 l //查看Central路由器的Serial 0端口连接的线缆
HD unit 0, idb = 0xC1E3C, driver structure at 0xC72D0
buffer size 1524 HD unit 0, V.35 DCE cable, clockrate 64000 l //确认Central路由器连接的是电缆的DCE端
cpb = 0x21, eda = 0x4940, cda = 0x4800
RX ring with 16 entries at 0x214800
………………

  下面,在特权模式下,配置Central路由器的基本信息:

Router#configure terminal //进入配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Central //配置路由器名称为 Central
Central(config)#enable password cisco //配置enable口令(进入特权模式的口令)为 cisco
Central(config)#
Central(config)#interface ethernet 0 //进入以太网端口配置视图
Central(config-if)#ip address 192.168.1.1 255.255.255.0 //配置以太网端口地址
Central(config-if)#description Connect_To_CentralNetwork //添加端口描述
Central(config-if)#no shutdown //激活以太网端口
Central(config-if)#
Central(config-if)#int serial 0 //进入串口配置视图
Central(config-if)#ip address 10.0.0.5 255.255.255.252 //配置串口地址
Central(config-if)#clock rate 64000 //配置端口时钟
Central(config-if)#bandwidth 64 //配置端口带宽
Central(config-if)#description Connect_To_RouterThinkTop //添加端口描述
Central(config-if)#no shutdown //激活串口
Central(config-if)#end //退出配置模式
Central# //返回到了系统视图

  现在再来查看系统端口信息,可看到如下内容:

Central#show ip intface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0 192.168.1.1 YES manual up up
Serial0 10.0.0.5 YES manual up up
Serial1 unassigned YES unset administratively down down

  查看系统路由表,可得到如下信息:

Central#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, * - candidate default
U - per-user static route, o - ODR

Gateway of last resort is not set

C 10.0.0.4/30 is directly connected, Serial0
C 192.168.1.0/24 is directly connected, Ethernet0

  下面配置静态路由:

Central#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Central(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.6 //添加到对端网络的静态路由
Central(config)#end


Central#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, * - candidate default
U - per-user static route, o - ODR

Gateway of last resort is not set

C 10.0.0.4/30 is directly connected, Serial0
C 192.168.1.0/24 is directly connected, Ethernet0
S 192.168.2.0/24 [1/0] via 10.0.0.6 //多出一条静态路由

  添加用户及密码,配置系统登录口令:

Central#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Central(config)#username test password szptt //添加用户test,密码szptt;
Central(config)#line console 0 //进入控制台端口配置
Central(config-line)#login local //设置使用配置的用户名和密码验证用户
Central(config-line)#exit
Central(config)#line aux 0 //进入辅助端口配置
Central(config-line)#login local //设置使用配置的用户名和密码验证用户
Central(config-line)#line vty 0 4 //进入telnet端口配置
Central(config-line)#login local //设置使用配置的用户名和密码验证用户
Central(config-line)#end
Central#

  保存系统配置文件:

Central#copy running-config startup-config l //保存系统配置文件
Destination filename [startup-config]?
Building configuration...
[OK]
Central#
Central#

  • 配置路由器ThinkTop:

  路由器加电后,在控制台上可以看到如下消息输出:

System Bootstrap, Version 11.0(10c), SOFTWARE
Copyright (c) 1986-1996 by cisco Systems
2500 processor with 2048 Kbytes of main memory

Notice: NVRAM invalid, possibly due to write erase.

F3: 5653052+80216+423844 at 0x3000060

Restricted Rights Legend

Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software - Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.

cisco Systems, Inc.
170 West Tasman Drive
San Jose, California 95134-1706



Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-I-L), Version 12.0(12), RELEASE SOFTWARE (fc1) //路由器操作系统的版本,v12.0(12)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Tue 11-Jul-00 07:51 by htseng
Image text-base: 0x0302F400, data-base: 0x00001000

cisco 2500 (68030) processor (revision N) with 2048K/2048K bytes of memory.
Processor board ID 11141310, with hardware revision 00000000
Bridging software.
X.25 software, Version 3.0.0.
1 Ethernet/IEEE 802.3 interface(s)
2 Serial network interface(s)
32K bytes of non-volatile configuration memory.
8192K bytes of processor board System flash (Read ONLY) //路由器FLASH存储器的大小

  如果一个路由器没有配置文件存在,那么系统启动后会弹出如下提醒:

--- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: //是否需要进入初始配置对话?

  一般情况下,我们都会输入 NO,选择不进入初始配置对话,以便在标准配置模式下完成设备配置

--- System Configuration Dialog ---

Would you like to enter the initial configuration dialog? [yes/no]: no
Would you like to terminate autoinstall? [yes]:Yes
Press RETURN to get started! //敲下回车键,进入设备配置界面

00:00:21: %LINK-3-UPDOWN: Interface Ethernet0, changed state to up
00:00:21: %LINK-3-UPDOWN: Interface Serial0, changed state to up
00:00:21: %LINK-3-UPDOWN: Interface Serial1, changed state to down
00:00:22: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to up
00:00:22: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to up
00:00:22: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1, changed state to down
00:00:44: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0, changed state to down
00:00:45: %LINK-5-CHANGED: Interface Serial0, changed state to administratively down
00:00:45: %LINK-5-CHANGED: Interface Ethernet0, changed state to administratively down
00:00:45: %LINK-5-CHANGED: Interface Serial1, changed state to administratively down
00:00:46: %IP-5-WEBINST_KILL: Terminating DNS process
00:00:46: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet0, changed state to down
00:00:47: %SYS-5-RESTART: System restarted --
Cisco Internetwork Operating System Software
IOS (tm) 2500 Software (C2500-I-L), Version 12.0(12), RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2000 by cisco Systems, Inc.
Compiled Tue 11-Jul-00 07:51 by htseng
Router>
Router> //本提示符,> ,意味着进入了路由器操作系统的用户模式,即最基本的用户界面。

  如要进行设备的配置动作,必须进入特权模式。使用 enalbe 和 disable 命令在用户模式和特权模式之间切换:

Router>enable //进入特权模式
Router# //本提示符,#,意味着进入了路由器操作系统的特权模式。
Router#disable //返回用户模式
Router>

  下面,确认系统的基本信息:

Router#show ip interface brief //查看ThinkTop路由器上的所有端口

Interface IP-Address OK? Method Status Protocol
Ethernet0 unassigned YES unset administratively down down
Serial0 unassigned YES unset administratively down down
Serial1 unassigned YES unset administratively down down

  //系统上有三个接口:一个以太网端口:Ethernet 0,两个串口:Serial 0和Serial 1

Router#show controllers serial 0 l //查看ThinkTop路由器的Serial 0端口连接的线缆
HD unit 0, idb = 0xC1E3C, driver structure at 0xC72D0
buffer size 1524 HD unit 0, V.35 DTE cable //确认ThinkTop路由器连接的是电缆的DTE端
cpb = 0x21, eda = 0x4940, cda = 0x4800
RX ring with 16 entries at 0x214800
………………

  下面,在特权模式下,配置Central路由器的基本信息:

Router#configure terminal //进入配置模式
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname Central //配置路由器名称为 ThinkTop
ThinkTop(config)#enable password cisco //配置enable口令(进入特权模式的口令)为 cisco
ThinkTop(config)#
ThinkTop(config)#interface ethernet 0 //进入以太网端口配置视图
ThinkTop(config-if)#ip address 192.168.2.1 255.255.255.0 //配置以太网端口地址
ThinkTop(config-if)#description Connect_To_ClientNetwork //添加端口描述
ThinkTop(config-if)#no shutdown //激活以太网端口
ThinkTop(config-if)#
ThinkTop(config-if)#int serial 0 //进入串口配置视图
ThinkTop(config-if)#ip address 10.0.0.6 255.255.255.252 //配置串口地址
ThinkTop(config-if)#bandwidth 64 //配置端口带宽
ThinkTop(config-if)#description Connect_To_RouterCentral //添加端口描述
ThinkTop(config-if)#no shutdown //激活串口
ThinkTop(config-if)#end //退出配置模式
ThinkTop# //返回到了系统视图

  现在再来查看系统端口信息,可看到如下内容:

ThinkTop#show ip intface brief
Interface IP-Address OK? Method Status Protocol
Ethernet0 192.168.2.1 YES manual up up
Serial0 10.0.0.6 YES manual up up
Serial1 unassigned YES unset administratively down down

  查看系统路由表,可得到如下信息:

ThinkTop#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, * - candidate default
U - per-user static route, o - ODR

Gateway of last resort is not set

C 10.0.0.4/30 is directly connected, Serial0
C 192.168.2.0/24 is directly connected, Ethernet0

  下面配置静态路由:

ThinkTop#conf t
Enter configuration commands, one per line. End with CNTL/Z.
ThinkTop(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.5 //添加到对端网络的静态路由
ThinkTop(config)#end


ThinkTop#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, * - candidate default
U - per-user static route, o - ODR

Gateway of last resort is not set

C 10.0.0.4/30 is directly connected, Serial0
C 192.168.2.0/24 is directly connected, Ethernet0
S 192.168.1.0/24 [1/0] via 10.0.0.5 //多出一条静态路由

  添加用户及密码,配置系统登录口令:

ThinkTop#conf t
Enter configuration commands, one per line. End with CNTL/Z.
ThinkTop(config)#username test password szptt //添加用户test,密码szptt;
ThinkTop(config)#line console 0 //进入控制台端口配置
ThinkTop(config-line)#login local //设置使用配置的用户名和密码验证用户
ThinkTop(config-line)#exit
ThinkTop(config)#line aux 0 //进入辅助端口配置
ThinkTop(config-line)#login local //设置使用配置的用户名和密码验证用户
ThinkTop(config-line)#line vty 0 4 //进入telnet端口配置
ThinkTop(config-line)#login local //设置使用配置的用户名和密码验证用户
ThinkTop(config-line)#end
ThinkTop#

  保存系统配置文件:

ThinkTop#copy running-config startup-config l //保存系统配置文件
Destination filename [startup-config]?
Building configuration...
[OK]
ThinkTop#
ThinkTop#

 

  • 确认在PC 1上ping PC2的地址:192.168.2.2能通,并且在PC 2上ping PC 1的地址:192.168.1.2也能通讯,则证明配置成功。