|
实验6:思科基本配置命令综合训练(上)
实验目标:
1.通过综合实验复习思科交换机、路由器的基本配置命令.
2.深度挖掘PT模拟器的功能
实验要求:
1.根据拓扑所示,配置设备用户名、DCE时钟、接口和PC地址等,确保所有直连网络的通信.
2.关闭所有设备的域名解析、开启日志同步、关闭console口的配置超时、VTY的超时为5分30秒.
3.配置所有设备的特权加密密码:ciscoccna@;console密码:ciscoccnp#;vty(0-4)密码(SW1除外
):ciscoccie$;所有password都需加密;并配置R2登陆横幅:this is R2,接口描述为:connect R1.
4.关闭连接PC端口的CDP.
5.确保PC0可以远程管理SW1,可以使用下列用户名密码登陆:用户名ccna,密码ccna;
用户名ccnp,密码ccnp;用户名ccie,密码ccie.
6.通过TFTP服务器备份R1的启动文件,备份SW1的IOS.
7.PC0可以访问WEB服务器,域名为www.google.com
8.在R1上配置LOG服务器和NTP服务器.
9.还原R2的特权密码为空.
1.根据拓扑所示,配置设备用户名、DCE时钟、接口和PC地址等,确保所有直连网络的通信.
1)配置路由器R2用户名、DCE时钟、接口地址:
Router>ena
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#inter s0/3/0
R2(config-if)#ip add 172.168.1.1 255.255.255.0
R2(config-if)#clock rate 64000
R2(config-if)#no shut
DCE ata Communication Equipment(数据通信设备或者数据电路终端设备):该设备和其与通信网络的连
接构成了网络终端的用户网络接口。它提供了到网络的一条物理连接、转发业务量,并且提供了一个用于同
步DCE设备和DTE设备之间数据传输的时钟信号。调制解调器和接口卡都是DCE设备的例子。
DTE ata Terminal Equipment(数据终端设备):指的是位于用户网络接口用户端的设备,它能够作为
信源、信宿或同时为二者。数据终端设备通过数据通信设备(例如,调制解调器)连接到一个数据网络上,
并且通常使用数据通信设备产生的时钟信号。数据终端设备包括计算机、协议翻译器以及多路分解器等设备。
怎么知道哪些端口是DCE需要配时钟呢?方法1:在模拟器上,需要配时钟的端口上一个代表DCE的时钟图标.
方法2:在线缆上会有标识,一端写着DCE,另一端写着DTE.方法3:在命令里输入show controllers s0/3/0查看.
2)配置路由器R1用户名、接口地址:
Router>ena
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R1
R1(config)#inter s0/3/0
R1(config-if)#ip add 172.168.1.2 255.255.255.0
R1(config-if)#no shut
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/3/0, changed state to up
inter fa0/0
R1(config-if)#ip add 192.168.2.254 255.255.255.0
R1(config-if)#no shut
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
R1(config-if)#inter fa0/1
R1(config-if)#ip add 192.168.1.254 255.255.255.0
R1(config-if)#no shut
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
3)配置交换机SW1用户名、接口地址:
Switch>ena
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#host SW1
SW1(config)#inter vlan 1
SW1(config-if)#ip add 192.168.2.253 255.255.255.0
SW1(config-if)#no shut
SW1(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
end
SW1#
4)配置三台PC和两台服务器的IP地址并ping通default gateway ip,非常重要!保证所有直连网络的通信,
才能保证其他非直连网络的通信,往往错误就发生在最简单基本的地方.
PC0:IP Address:192.168.1.1 Subnet Mask 255.255.255.0 Default Gateway: 192.168.1.254
C:\>ping 192.168.1.254
Pinging 192.168.1.254 with 32 bytes of data:
Reply from 192.168.1.254: bytes=32 time=4ms TTL=255
Reply from 192.168.1.254: bytes=32 time<1ms TTL=255
Reply from 192.168.1.254: bytes=32 time<1ms TTL=255
Reply from 192.168.1.254: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.1.254:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 4ms, Average = 1ms
PC1:IP Address:192.168.2.1 Subnet Mask 255.255.255.0 Default Gateway: 192.168.2.254
C:\>ping 192.168.2.254
Pinging 192.168.2.254 with 32 bytes of data:
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.2.254:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
PC2:IP Address:192.168.2.2 Subnet Mask 255.255.255.0 Default Gateway: 192.168.2.254
C:\>ping 192.168.2.254
Pinging 192.168.2.254 with 32 bytes of data:
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.2.254:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
S1:IP Address:192.168.2.3 Subnet Mask 255.255.255.0 Default Gateway: 192.168.2.254
C:\>ping 192.168.2.254
Pinging 192.168.2.254 with 32 bytes of data:
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.2.254:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
S2:IP Address:192.168.2.4 Subnet Mask 255.255.255.0 Default Gateway: 192.168.2.254
C:\>ping 192.168.2.254
Pinging 192.168.2.254 with 32 bytes of data:
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Reply from 192.168.2.254: bytes=32 time<1ms TTL=255
Ping statistics for 192.168.2.254:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
5)在R1上ping通R2和SW1直连端口:
R1>ping 172.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/7 ms
R1>ping 192.168.2.253
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.253, timeout is 2 seconds:
..!!!
Success rate is 60 percent (3/5), round-trip min/avg/max = 0/0/0 ms
2.关闭所有设备的域名解析、开启日志同步、关闭console口的配置超时、VTY的超时为5分30秒.
1)关闭R2的域名解析、开启日志同步、关闭console口的配置超时、VTY的超时为5分30秒
R2(config)#no ip domain-lookup
R2(config)#line console 0
R2(config-line)#logg syn
R2(config-line)#exec-timeout 0 0
R2(config-line)#end
R2#
%SYS-5-CONFIG_I: Configured from console by console
R2#ena
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#line vty 0 4
R2(config-line)#logg syn
R2(config-line)#exec-timeout 0 0
R2(config-line)#exec-timeout 5 30
2)关闭R1的域名解析、开启日志同步、关闭console口的配置超时、VTY的超时为5分30秒
R1>ena
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#no ip domain-l
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#logg syn
R1(config-line)#exec-timeout 0 0
R1(config-line)#line vty 0 4
R1(config-line)#logg syn
R1(config-line)#exec-timeout 5 30
3)关闭SW1的域名解析、开启日志同步、关闭console口的配置超时、VTY的超时为5分30秒
SW1>ena
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#no ip domain-lookup
SW1(config)#line console 0
SW1(config-line)#logg syn
SW1(config-line)#exec-timeout 0 0
SW1(config-line)#line vty 0 4
SW1(config-line)#logg syn
SW1(config-line)#exec-timeout 5 30
3.配置所有设备的特权加密密码:ciscoccna@;console密码:ciscoccnp#;vty(0-4)密码(SW1除外
):ciscoccie$;所有password都需加密;并配置R2登陆横幅:this is R2,接口描述为:connect R1.
1)配置R2的特权加密密码:ciscoccna@;console密码:ciscoccnp#;vty(0-4)密码:ciscoccie$;
所有password都需加密;
R2(config)#ena secret ciscoccna@
R2(config)#line con 0
R2(config-line)#pass ciscoccnp#
R2(config-line)#login
R2(config-line)#line vty 0 4
R2(config-line)#pass ciscoccie$
R2(config-line)#login
R2(config)#service password-encryption
2)配置R1的特权加密密码:ciscoccna@;console密码:ciscoccnp#;vty(0-4)密码:ciscoccie$;
所有password都需加密;
R1(config)#ena secret ciscoccna@
R1(config)#line con 0
R1(config-line)#pass ciscoccnp#
R1(config-line)#login
R1(config-line)#line vty 0 4
R1(config-line)#pass ciscoccie$
R1(config-line)#login
R1(config)#service password-encryption
3)配置SW1的特权加密密码:ciscoccna@;console密码:ciscoccnp#;所有password都需加密;
SW1(config)#ena secret ciscoccna@
SW1(config)#line con 0
SW1(config-line)#pass ciscoccnp#
SW1(config-line)#exit
SW1(config)#ser pass
4)配置R2登陆横幅:this is R2,接口描述为:connect R1.
R2(config)#banner motd # this is R2 #
R2(config)#inter s0/3/0
R2(config-if)#description connect R1
4.关闭连接PC端口的CDP.这样可以关闭不必要的数据包.因为CDP是私有协议不能检测非思科设备.
CDP是Cisco Discovery Protocol的缩写,它是由思科公司推出的一种私有的二层网络协议,它能够运行
在大部分的思科设备上面。通过运行CDP 协议,思科设备能够在与它们直连的设备之间分享有关操作系
统软件版本,以及IP地址,硬件平台等相关信息。因为它不依赖任何的三层协议,透过CDP协议,可以帮
助我们解决一些三层错误配置的故障,比如错误的三层地址等等。
no cdp run用于全局模式,no cdp enable用于接口模式
1)关闭R1连接PC端口f0/1的CDP
R1(config)#inter f0/1
R1(config-if)#no cdp enable
2)关闭SW1连接PC端口f0/1,f0/2,f0/3和f0/4的CDP
SW1(config)#inter range fa0/1-4
SW1(config-if-range)#no cdp en
对于不连续的一组端口使用range命令可以用逗号来隔开,例如inter range fa0/1,fa0/4,fa0/5-9
实验6:思科基本配置命令综合训练(下)
5.确保PC0可以远程管理SW1,可以使用下列用户名密码登陆:用户名ccna,密码ccna;
用户名ccnp,密码ccnp;用户名ccie,密码ccie.
1)PC0和SW1不在同一网段,交换机想要被跨网段的远程访问.首先要在交换机上配置管理IP地址,并且还要
设置交换机的默认网关.实验1-3配置了SW1管理IP地址,需要再配置SW1默认网关.ping属于第三层,而telnet
属于第七层.如果第三层都不通,那第七层肯定是不通的.
SW1(config)#ip default-gateway 192.168.2.254
再到PC0 ping通SW1.
SW1(config)#username ccna password ccna
SW1(config)#us ccnp pass ccnp
SW1(config)#us ccie pass ccie
SW1(config)#line vty 0 4
使用本地凭证登陆SW1(config-line)#login local
到PCO上telnet.
C:\>telnet 192.168.2.253
Trying 192.168.2.253 ...Open
User Access Verification
Username: ccna
Password:
SW1>
6.通过TFTP服务器备份R1的启动文件,备份SW1的IOS.
R1#copy startup-config tftp:
Address or name of remote host []? 192.168.2.4
Destination filename [R1-confg]?
Writing startup-config....!!
[OK - 916 bytes]
916 bytes copied in 3.007 secs (304 bytes/sec)
SW1#copy flash: tftp:
Source filename []? c2960-lanbase-mz.122-25.FX.bin
Address or name of remote host []? 192.168.2.4
Destination filename [c2960-lanbase-mz.122-25.FX.bin]? c2960-text
Writing c2960-lanbase-mz.122-25.FX.bin....!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 4414921 bytes]
4414921 bytes copied in 3.082 secs (38920 bytes/sec)
7.PC0可以访问WEB服务器,域名为www.google.com
配置PC0的DNS为Web服务器的ip:192.168.2.3 ->确保DNS服务器HTTP和DNS服务开启->将指定域名映射到DNS
服务器的IP
8.在R1上配置LOG服务器和NTP服务器.LOG服务器作用是将R1上的日志同步到LOG服务器.
确认NTP服务器开启NTP服务并同步本地的英文日历-> R1(config)#ntp server 192.168.2.4->ntp update-calendar
LOG服务器的LOG服务开启->R1(config)#logging host 192.168.2.4->service timestamps log datetime msec
9.还原R2的特权密码为空.
重启R2时按住Ctrl+c或者break
rommon 1 > confreg 0x2142
rommon 2 > reset
Router#copy startup-config running-config
Destination filename [running-config]?
957 bytes copied in 0.416 secs (2300 bytes/sec)
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#no enable secret
R2(config)#config-register 0x2102
R2(config)#end
R2#wr
Building configuration...
[OK]
|
|