2010年9月15日星期三

路由器的基本配置

西安交通大学实验报告

课程:网络技术实验 
完成时间:2010年5月11日
实验名称:路由器的基本配置

实验内容

    使用Boson NetSim软件模拟出路由器的环境,并测试路由器的各种指令。

    使用Boson Network Designer配置了一个只含有一个路由器的网络环境,如图:



    进入NetSim软件的命令行模式,开始对路由器进行配置。

    键入enable指令,进入路由器的配置模式:


    此时如键入disable指令,即为退出配置模式,回到用户模式。键入问号“?”可以获取当前的命令列表。键入不完整的命令关键字后接问号可以获取智能提示,如“sho?”可以返回“show”这一指令。

    使用show running-config指令可以查看当前运行的配置:
Router#show config
%% Non-volatile configuration memory is not present
Router#show running-config
Building configuration...

!
Version 12.1
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Router
!
!
!
ip subnet-zero
!
!
!
!
!
!
!
!
interface Ethernet0/0
 no ip address
 no ip directed-broadcast
 shutdown
!
interface Ethernet0/1
 no ip address
 no ip directed-broadcast
 shutdown
!
!
ip classless
no ip http server
!
!
!
!
line con 0
 transport input none
line aux 0
line vty 0 4
!
no scheduler allocate
end
    使用show protocols指令查看当前载入的协议栈:

Router# show protocols
Global values:
  Internet Protocol routing is enabled
Ethernet0/0 is administratively down, line protocol is down
Ethernet0/1 is administratively down, line protocol is down
    使用show version指令查看模拟器的版本:

Router#show version

Boson Operating Simulation Software
BOSS (tm) C4500 Software (C4500-Enterprise), Version 12.1, RELEASE SOFTWARE
Copyright (c) 1998-2003 by Boson Software, Inc.

BOSS ROM: System Bootstrap, Version 12.2, RELEASE SOFTWARE
Router Uptime Is 0 days, 0 hours, 15 minutes
System restarted by power-on
System image file is ""flash:c4500-enterprise.12.1.boss"", booted via flash
Boson 4500 (BOSS) processor (revision 5.0)
2 Ethernet/IEEE 802.3 interface(s)

32K bytes of simulated non-volatile configuration memory.
8192K bytes of simulated System flash (Read/Write)


Configuration register is 0X2102
    使用show clock指令查看路由器内部时间:

Router#show clock
*00:17:31 UTC March 1 1993

    使用show hosts查看路由器内部维护的主机列表(本例中为空返回)。

    使用show interfaces指令查看路由器的接口情况(本例中使用了双以太接口路由器):

Router#show interfaces
Ethernet0/0 is administratively down, line protocol is down
  Hardware is Lance, address is 000C.5280.8720 (bia 000C.5280.8720)
  MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, rely 255/255, load 1/255
  Encapsulation ARPA, loopback not set, keepalive set (10 sec)
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Queueing strategy: fifo
  Output queue 0/40, 0 drops; input queue 0/75, 0 drops
  5 minute input rate 1000 bits/sec, 2 packets/sec
  5 minute output rate 1000 bits/sec, 2 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
Ethernet0/1 is administratively down, line protocol is down
  Hardware is Lance, address is 000C.6195.7822 (bia 000C.6195.7822)
  MTU 1500 bytes, BW 10000 Kbit, DLY 1000 usec, rely 255/255, load 1/255
  Encapsulation ARPA, loopback not set, keepalive set (10 sec)
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:00, output 00:00:00, output hang never
  Last clearing of "show interface" counters never
  Queueing strategy: fifo
  Output queue 0/40, 0 drops; input queue 0/75, 0 drops
  5 minute input rate 1000 bits/sec, 2 packets/sec
  5 minute output rate 1000 bits/sec, 2 packets/sec
     0 packets input, 0 bytes, 0 no buffer
     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 input packets with dribble condition detected
     0 packets output, 0 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out
    使用config t进行配置,本例中,设置路由器主机名为router1,密码为r1psw,退出进行重新登录:
Router# config t
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname router1
router1(config)#enable password r1psw
router1(config)#exit
router1#exit
Router con0 is now available
Press RETURN to get started.
router1>
router1>enable
Enter password:
    值得注意的是,登录时密码不回显,这样提高了安全性。
    在配置模式下使用banner motd z指令配置路由器欢迎信息,以z结束:

router1#config t
Enter configuration commands, one per line.  End with CNTL/Z.
router1(config)#banner motd z
Enter the text followed by the 'z' to finish
Across the Great Wall we can reach every corner in the world.z
router1(config)#exit
router1#exit
Router con0 is now available
Press RETURN to get started.
Across the Great Wall we can reach every corner in the world.
router1>

    (1987年9月14日21时07分,中国第一封电子邮件从北京发往德国,内容是“越过长城,走向世界”。)
    使用copy指令可以进行配置文件的操作,如copy running-config startup-config可以将当前的配置文件设置为启动配置文件:

router1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
    使用reload指令重载配置信息:

(路由器被重启,以下是重启后返回的信息)
Press Enter to Start
Simulated Bootstrap, Version 5.0, RELEASE SOFTWARE
Copyright (c) 1998-2003 by Boson Systems, Inc.
C4500 Simulated processor with 20480 Kbytes of main memory
Self decompressing the image : ######################################## [OK]
Boson Operating Simulation System
BOSS (tm) 4500 Simulator (C4500-enterprise), Version 5.0, RELEASE SOFTWARE
Copyright (c) 1998-2003 by Boson Software
Simulated Image
Boson 4500 (BOSS) emulator (revision 5.0) with 20480K/512K simulated memory.
BOSS, Version 5.0
2 Ethernet/IEEE 802.3 interface(s)
7K bytes of simulated non-volatile configuration memory.
8192K bytes of simulated processor flash (Read/Write)

(完)

没有评论:

发表评论