数据通信与网络技术实验指导书
实验四 HW-RouteSim仿真实验
一、实验目的
1、掌握交换机端口的配置方法; 2、掌握静态路由算法的特点及配置方法; 3、掌握RIP路由协议的配置方法; 4、了解访问列表的设置方法。
二、实验环境
计算机
HW-RouterSim仿真软件
三、HW-RouteSim命令简介
计算机命令:
PCA login: root password: linux # shutdown -h now # init 0 # logout # login
# ifconfig # ifconfig eth0
# route add default gw
switch: hostname> 4
root用户linux IP地址 IP地址 ROM状态
;使用 ;口令是;关机;关机;显示;设置;设置网关;删除网关;显示网关;;用户模式数据通信与网络技术实验指导书
hostname# ;特权模式 hostname(config)# ;全局配置模式 hostname(config-if)# ;接口状态 交换机口令设置:
switch>enable ;进入特权模式 switch#config terminal ;进全局配置模式 switch(config)#hostname
switch(config-line)#line vty 0 4 switch(config-line)#login switch(config-line)#password xx switch#exit 交换机VLAN设置:
switch#vlan database switch(vlan)#vlan 2 switch(vlan)#no vlan 2 switch(config)#int f0/1 switch(config-if)#switchport access vlan 2 switch(config-if)#switchport mode trunk 交换机设置IP地址:
switch(config)#interface vlan 1 switch(config-if)#ip address
switch#write switch#show run switch#show vlan 5
;设置特权加密口令 ;设置特权非密口令;进控制台口(Rs232);进入虚拟终端 ;允许登录 ;设置登录口令xx ;返回命令 ;进入VLAN设置 ;建VLAN 2 ;删vlan 2 ;进入端口1 ;端口加入VLAN 2 ;设置为干线 ;进入vlan 1 ;添加远程登录IP ;添加默认网关 ;查看内存 ;写入保存 ;查看当前配置信息 ;看VLAN
数据通信与网络技术实验指导书
switch#show interface ;显示所有端口信息 switch#show int f0/0 ;显示端口0的信息 switch#reload ;重新起动 路由器显示命令:
router#show run ;显示接口 router#show interface ;显示接口 router#show ip route ;显示路由 router#show cdp nei ;看阾居 设置口令:
router>enable ;进入特权模式 router#config terminal ;进入全局配置模式 router(config)#hostname
router(config)#enable secret xxx ;设置特权加密口令 router(config)#enable password xxx ;设置特权非密口 router(config)#line console 0 ;进控制台口初始化 router(config-line)#line vty 0 4 ;进入虚拟终端 router(config-line)#login ;允许登录 router(config-line)#password xx ;设置登录口令xx router(config)# (Ctrl+z) ;返回特权模式 router#exit ;返回命令 配置IP地址:
router(config)#int s0/0 ;进行串接口 router(config-if)#no shutdown ;起动接口 router(config-if)#clock rate 64000 ;设置时钟 router(config-if)#ip address 10.1.1.1 255.255.0.0 ;设置IP地址和子网掩码
router(config-if)#ip add 10.1.1.2 255.255.0.0 second; router(config-if)#int f0/0.1 ;进入子接口 router(config-subif.1)#ip address
6
数据通信与网络技术实验指导书
router(config)#config-register 0x2142 ;跳过配置文件 router(config)#config-register 0x2102 ;正常使用配置文件 router#reload ;重新引导 复制操作:
router#copy running-config startup-config ;存配置 router#copy running-config tftp ;上载 router#copy startup-config tftp
router#copy tftp flash: ;特权模式下升级IOS router#copy tftp startup-config ;下载配置文件到nvram ROM状态:
Ctrl+Break ;进入ROM监控状态 rommon>confreg 0x2142 ;跳过配置 rommon>confreg 0x2102 ;使用配置 rommon>reset ;重新引导 rommon>copy xmodem:
rommon>dir flash: ;查看闪存中的内容 rommon>boot ;引导IOS 静态路由:
ip route
router(config)#ip route 10.1.0.0 255.255.0.0 10.2.1.1 router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 动态路由:
router(config)#ip routing ;启动路由
router(config)#router rip ;启动RIP路由协议 router(config-router)#network
7
数据通信与网络技术实验指导书
router(config-router)#negihbor
router(config)# frame-relay switching ;使能帧中继交换 router(config-s0)# encapsulation frame-relay ;使能帧中继 router(config-s0)# frame-relay intf-type DCE ;DCE端(需要配虚电路)
router(config-s0)# frame-relay local-dlci 20 ;配置虚电路号 基本访问控制列表:
router(config)#access-list
RB(config)#access-list 4 permit 10.8.1.1 RB(config)#access-list 4 deny 10.8.1.0 0.0.0.255 RB(config)#access-list 4 permit 10.8.0.0 0.0.255.255 RB(config)#access-list 4 deny 10.0.0.0 0.255.255.255 RB(config)#access-list 4 permit any RB(config)#int f0/0
RB(config-if)#ip access-group 4 in 扩展访问控制列表:
access-list
access-list
router(config)# access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo router(config)# access-list 101 permit ip any any router(config)# int s0/0
router(config-if)#ip access-group 101 in 例2:
router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
8