思科模拟器命令.doc_第1页
思科模拟器命令.doc_第2页
思科模拟器命令.doc_第3页
思科模拟器命令.doc_第4页
思科模拟器命令.doc_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1. 计算机命令:PCA login: root ;使用root用户password: linux ;口令是linux# shutdown -h now ;同init 0 关机# logout# login# ifconfig ;显示IP地址# ifconfig eth0 netmask ;设置IP地址# ifconfig eht0 netmask down ; 删除IP地址# route add gw # route del gw # route add default gw ;设置网关# route del default gw ;删除网关# route ;显示网关# ping # telnet 2. 交换机支持的命令:交换机基本状态:switch: ;交换机的ROM状态rommon ;路由器的ROM状态hostname ;用户模式hostname# ;特权模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口状态交换机口令设置:switchenable ;进入特权模式switch#config terminal ;进入全局配置模式switch(config)#hostname ;设置交换机的主机名switch(config)#enable secret xxx ;设置特权加密口令switch(config)#enable password xxa ;设置特权非密口令switch(config)#line console 0 ;进入控制台口switch(config-line)#line vty 0 4 ;进入虚拟终端switch(config-line)#login ;允许登录switch(config-line)#password xx ;设置登录口令xxswitch#exit ;返回命令交换机VLAN设置:switch#vlan database ;进入VLAN设置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;删vlan 2switch(config)#int f0/1 ;进入端口1switch(config-if)#switchport access vlan 2 ;当前端口加入vlan 2switch(config-if)#switchport mode trunk ;设置为干线switch(config-if)#switchport trunk allowed vlan 1,2 ;设置允许的vlanswitch(config-if)#switchport trunk encap dot1q ;设置vlan 中继switch(config)#vtp domain ;设置发vtp域名switch(config)#vtp password ;设置发vtp密码switch(config)#vtp mode server ;设置发vtp模式switch(config)#vtp mode client ;设置发vtp模式交换机设置IP地址:switch(config)#interface vlan 1 ;进入vlan 1switch(config-if)#ip address ;设置IP地址switch(config)#ip default-gateway ;设置默认网关switch#dir flash: ;查看闪存交换机显示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看当前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息3. 路由器支持的命令:路由器显示命令:router#show run ;显示配置信息router#show interface ;显示接口信息router#show ip route ;显示路由信息router#show cdp nei ;显示邻居信息router#reload ;重新起动路由器口令设置:routerenable ;进入特权模式router#config terminal ;进入全局配置模式router(config)#hostname ;设置交换机的主机名router(config)#enable secret xxx ;设置特权加密口令router(config)#enable password xxb ;设置特权非密口令router(config)#line console 0 ;进入控制台口router(config-line)#line vty 0 4 ;进入虚拟终端router(config-line)#login ;要求口令验证router(config-line)#password xx ;设置登录口令xxrouter(config)#(Ctrl+z) ; 返回特权模式router#exit ;返回命令路由器配置:router(config)#int s0/0 ;进入Serail接口router(config-if)#no shutdown ;激活当前接口router(config-if)#clock rate 64000 ;设置时钟频率router(config-if)#ip address ;设置IP地址router(config-if)#ip address second ;设置第二个IProuter(config-if)#int f0/0.1 ;进入子接口router(config-subif.1)#ip address ;设置子接口IProuter(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议router(config)#config-register 0x2142 ;跳过配置文件router(config)#config-register 0x2102 ;正常使用配置文件router#reload ;重新引导路由器文件操作:router#copy running-config startup-config ;保存配置router#copy running-config tftp ;保存配置到tftprouter#copy startup-config tftp ;开机配置存到tftprouter#copy tftp flash: ;下传文件到flashrouter#copy tftp startup-config ;下载配置文件ROM状态:Ctrl+Break ;进入ROM监控状态rommonconfreg 0x2142 ;跳过配置文件rommonconfreg 0x2102 ;恢复配置文件rommonreset ;重新引导rommoncopy xmodem: flash: ;从console传输文件rommonIP_ADDRESS= ;设置路由器IPrommonIP_SUBNET_MASK= ;设置路由器掩码rommonTFTP_SERVER= ;指定TFTP服务器IPrommonTFTP_FILE=c2600.bin ;指定下载的文件rommontftpdnld ;从tftp下载rommondir flash: ;查看闪存内容rommonboot ;引导IOS静态路由:ip route ;命令格式router(config)#ip route ;静态路由举例router(config)#ip route ;默认路由举例动态路由:router(config)#ip routing ;启动路由转发router(config)#router rip ;启动RIP路由协议。router(config-router)#network ;设置发布路由router(config-router)#negihbor ;点对点帧中继用。帧中继命令:router(config)#frame-relay switching ;使能帧中继交换router(config-s0)#encapsulation frame-relay ;使能帧中继router(config-s0)#fram-relay lmi-type cisco ;设置管理类型router(config-s0)#frame-relay intf-type DCE ;设置为DCErouter(config-s0)#frame-relay dlci 16 ;router(config-s0)#frame-relay local-dlci 20 ;设置虚电路号router(config-s0)#frame-relay interface-dlci 16 ;router(config)#log-adjacency-changes ;记录邻接变化router(config)#int s0/0.1 point-to-point ;设置子接口点对点router#show frame pvc ;显示永久虚电路router#show frame map ;显示映射基本访问控制列表:router(config)#access-list permit|deny router(config)#interface ;default:deny anyrouter(config-if)#ip access-group in|out ;defaultut例1:router(config)#access-list 1 deny host router(config)#access-list 1 permit anyrouter(config)#int f0/0router(config-if)#ip access-group 4 in例2:router(config)#access-list 4 permit router(config)#access-list 4 deny 55router(config)#access-list 4 permit 55router(config)#access-list 4 deny 55router(config)#access-list 4 permit anyrouter(config)#int f0/1router(config-if)#ip access-group 4 in扩展访问控制列表:access-list permit|deny icmp typeaccess-list permit|deny tcp port例1:router(config)#access-list 101 deny icmp any echorouter(config)#access-list 101 permit ip any anyrouter(config)#int s0/0router(config-if)#ip access-group 101 in例2:router(config)#access-list 102 deny tcp any eq 80router(config)#access-list 102 permit ip any anyrouter(config)#interface s0/1router(config-if)#ip access-group 102 out删除访问控制例表:router(config)#no access-list 102router(config-if)#no ip access-group 101 in路由器的nat配置Router(config-if)#ip nat inside ;当前接口指定为内部接口Router(config-if)#ip nat outside ;当前接口指定为外部接口Router(config)#ip nat inside source static p portRouter(config)#ip nat inside source static Router(config)#ip nat inside source static tcp 80 80Router(config)#ip nat pool p1 0 Router(config)#ip nat inside source list 1 pool p1Router(config)#ip nat inside destination list 2 pool p2Router(config)#ip nat inside source list 2 interface s0/0 overloadRouter(config)#ip nat pool p2 type rotaryRouter#show ip nat translationrotary 参数是轮流的意思,地址池中的IP轮流与NAT分配的地址匹配。overload参数用于PAT 将内部IP映射到一个公网IP不同的端口上。外部网关协议配置routerA(config)#router bgp 100routerA(config-router)#network routerA(config-router)#neighbor remote-as 200配置PPP验证:RouterA(config)#username password RouterA(config)#int s0RouterA(config-if)#ppp authentication chap|pap4PIX防火墙命令Pix525(config)#nameif ethernet0 outside security0 ;命名接口和级别Pix525(config)#interface ethernet0 auto ;设置接口方式Pix525(config)#interface ethernet1 100full ;设置接口方式Pix525(config)#interface ethernet1 100full shutdownPix525(config)#ip address inside Pix525(config)#ip address outside 52Pix525(config)#global (if_name) natid ip-ip ;定义公网IP区间Pix525(config)#global (outside) 1 -5 ;例句Pix525(config)#global (outside) 1 ;例句Pix525(config)#no global (outside) 1 ;去掉设置Pix525(config)#nat (if_name) nat_id local_ip netmarkPix525(config)#nat (inside) 1 0 0内网所有主机(0代表)可以访问global 1指定的外网。Pix525(config)#nat (inside) 1 内网/16网段的主机可以访问global 1指定的外网。Pix525(config)#route if_name 0 0 gateway_ip metric ;命令格式Pix525(config)#route outside 0 0 1 ;例句Pix525(config)#route inside 1 ;例句Pix525(config)#static (inside, outside) 表示内部ip地址,访问外部时被翻译成全局地址。Pix525(config)#static (dmz, outside) 中间区域ip地址,访问外部时被翻译成全局地址。 1. switch配置命令(1)模式转换命令用户模式-特权模式,使用命令enable特权模式-全局配置模式,使用命令config t全局配置模式-接口模式,使用命令interface+接口类型+接口号全局配置模式-线控模式,使用命令line+接口类型+接口号注:用户模式:查看初始化的信息.特权模式:查看所有信息、调试、保存配置信息全局模式:配置所有信息、针对整个路由器或交换机的所有接口接口模式:针对某一个接口的配置线控模式:对路由器进行控制的接口配置(2)配置命令show running config 显示所有的配置show versin 显示版本号和寄存器值shut down 关闭接口no shutdown 打开接口ip add +ip地址 配置IP地址secondary+IP地址 为接口配置第二个IP地址show interface+接口类型+接口号 查看接口管理性show controllers interface 查看接口是否有DCE电缆show history 查看历史记录show terminal 查看终端记录大小hostname+主机名 配置路由器或交换机的标识config memory 修改保存在NVRAM中的启动配置exec timeout 0 0 设置控制台会话超时为0service password-encryptin 手工加密所有密码enable password +密码 配置明文密码ena sec +密码 配置密文密码line vty 0 4/15 进入telnet接口password +密码 配置telnet密码line aux 0 进入AUX接口password +密码 配置密码line con 0 进入CON接口password +密码 配置密码bandwidth+数字 配置带宽no ip address 删除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config startup config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的谪要信息banner motd # +信息 + # 配置路由器或交换机的描素信息description+信息 配置接口听描素信息vlan database 进入VLAN数据库模式vlan +vlan号+ 名称 创建VLANswitchport access vlan +vlan号 为VLAN为配接口interface vlan +vlan号 进入VLAN接口模式ip add +ip地址 为VLAN配置管理IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名 配置SW的VTP域名vtp +password +密码 配置SW的密码switchport mode trunk 启用中继no vlan +vlan号 删除VLANshow spamming-tree vlan +vlan号 查看VLA怕生成树议2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址 配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器 等信息router rip 激活RIP协议network +直连网段 发布直连网段interface lookback 0 激活逻辑接口passive-interface +接口类型+接口号 配置接口为被动模式 debug ip +协议 动态查看路由更新信息undebug all 关闭所有DEBUG信息router eigrp +as号 激活EIGRP路由协议network +网段+子网掩码 发布直连网段show ip eigrp neighbors 查看邻居表show ip eigrp topology 查看拓扑表show ip eigrp traffic 查看发送包数量router ospf +process-ID 激活OSPF协议network+直连网段+area+区域号 发布直连网段show ip ospf 显示OSPF的进程号和ROUTER-IDencapsulation+封装格式 更改封装格式no ip admain-lookup 关闭路由器的域名查找ip routing 在三层交换机上启用路由功能 show user 查看SW的在线用户clear line +线路号 清除线路3. 三层交换机配置命令配置一组二层端口configure terminal 进入配置状态nterface range port-range 进入组配置状态配置三层端口configure terminal 进入配置状态interface fastethernet | gigabitethernet interface-id | vlan vlan-id | port-channel port-channel-number 进入端口配置状态no switchport 把物理端口变成三层口ip address ip_address subnet_mask 配置IP地址和掩码no shutdown 激活端口 例: Switch(config)# interface gigabitethernet0/2 Switch(config-if)# no switchport Switch(config-if)# ip address 1 Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。name vlan-name 可选)输入一个VLAN名,如果没有配置VLAN名,缺省的名字是VLAN号前面用0填满的4位数,如VLAN0004是VLAN4的缺省名字mtu mtu-size (可选) 改变MTU大小 例 Switch# configure terminal Switch(config)# vlan 20 Switch(config-vlan)# name test20 Switch(config-vlan)# end 或 Switch# vlan database Switch(vlan)# vlan 20 name test20 Switch(vlan)# exit将端口分配给一个VLANconfigure terminal 进入配置状态interface interface-id 进入要分配的端口switchport mode access 定义二层口switchport access vlan vlan-id 把端口分配给某一VLAN 例 Switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# interface fastethernet0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 2 Switch(config-if)# end Switch#配置VLAN trunkconfigure terminal 进入配置状态interface interface-Id 进入端口配置状态switchport trunk encapsulation isl | dot1q | negotiate配置trunk封装ISL 或 802.1Q 或自动协商switchport mode dynamic auto | desirable | trunk 配置二层trunk模式。dynamic auto自动协商是否成为trunkdynamic desirable把端口设置为trunk如果对方端口是trunk, desirable, 配置Native VLAN(802.1q)或自动模式,trunk设置端口为强制的trunk方式,而不理会对方端口是否为trunkswitchport access vlan vlan-id 可选) 指定一个缺省VLAN, 如果此端口不再是trunkswitchport trunk native vlan vlan-id 指定802.1Q native VLAN号 例: Switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# interface fastethernet0/4 Switch(config-if)# switchport mode trunk Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# end 定义TRUNK允许的VLANconfigure terminal子 进入配置状态interface interface-id 进入端口配置switchport mode trunk 配置二层口为trunkswitchport trunk allowed vlan add | all | except | remove vlan-list可选) 配置trunk允许的VLAN.使用add, all, except, remove关健字no switchport trunk allowed vlan 允许所有VLAN通过 例 Switch(config)# interface fastethernet0/1 Switch(config-if)# switchport trunk allowed vlan remove 2 Switch(config-if)# end配置Native VLAN(802.1q)configure terminal 进入配置状态interface interface-id 进入配置成802.1qtrunk的端口switchport trunk native vlan vlan-Id 配置native VLAN号no switchport trunk native vlan 端口配置命令回到缺省的状态配置基于端口权值的负载均衡configure terminal 进入Switch 1配置状态vtp domain domain-name 配置VTP域vtp mode server 将Switch 1配置成VTP server.show vtp status 验证VTP的配置show vlan 验证VLANconfigure terminal 进入配置状态interface fastethernet 0/1 进入F0/1端口switchport trunk encapsulation isl | dot1q | negotiate配置trunk封装switchport mode trunk 配置成trunkshow interfaces fastethernet0/1 switchport 验证VLAN配置按以上步骤对想要负载均衡的接口进行配置在另一个交换机上进行此配置show vlan 当trunk已经起来,在switch2上验证已经学到相的vlan配置configure terminal 在Switch 1上进入配置状态interface fastethernet0/1 进入要配置的端口spanning-tree vlan 8 port-priority 10 将端口权值10赋与VLAN 8.spanning-tree vlan 9 port-priority 10 将端口权值10赋与VLAN 9.spanning-tree vlan 10 port-priority 10 将端口权值10赋与VLAN 10.interface fastethernet0/2 进入F0/2spanning-tree vlan 3 port-priority 10 将端口权值10赋与VLAN 3.spanning-tree vlan 4 port-priority 10 将端口权值10赋与VLAN 4spanning-tree vlan 5 port-priority 10 将端口权值10赋与VLAN 5spanning-tree vlan 6 port-priority 10 将端口权值10赋与VLAN 10end 退出show running-config 验证配置copy running-config startup-config 保存配置配置STP路径值的负载均衡Trunk1走VLAN810,Trunk2走VLAN24configure terminal 进入 Switch 1配置状态interface fastethernet 0/1 进入F0/1switchport trunk encapsulation isl | dot1q | negotiate配置封装switchport mode trunk 配置Trunk,缺省是ISL封装exit 退回在F0/2口上重复24步骤exit 退回show running-config 验证配置show vlan验证switch1 已经学到Vlanconfigure terminal 进入配置状态interface fastethernet 0/1 进入F0/1spanning-tree vlan 2 cost 30 设置Vlan2生成树路径值为30spanning-tree vlan 3 cost 30 设置Vlan

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论