思科设备命令及实验大全

合集下载

思科路由器命令大全(完整版)

思科路由器命令大全(完整版)

思科路由器命令大全(完整版)思科路由器命令大全(完整版)本文档旨在提供思科路由器命令的详细说明和使用指南,包括路由器配置、网络管理、安全性设置等内容。

每个章节都详细介绍了不同的命令和参数,以帮助用户更好地理解和使用思科路由器。

1:路由器基本配置1.1 主机名设置1.2 用户名和密码设置1.3 IP 地址和子网掩码配置1.4 默认网关配置2:接口配置2.1 以太网接口配置2.2 串行接口配置2.3 子接口配置2.4 虚拟局域网 (VLAN) 配置3:路由协议配置3.1 静态路由配置3.2 动态路由配置3.2.1 RIP 配置3.2.2 OSPF 配置3.2.3 BGP 配置4:网络管理4.1 SNMP 配置4.2 NetFlow 配置4.3 Syslog 配置4.4 路由器时间设置5:安全性配置5.1 访问控制列表 (ACL) 配置5.2 VPN 配置5.3 防火墙配置5.4 AAA 配置附件:本文档附带的附件包括示例配置文件、命令输出示例等,以帮助读者更好地理解和应用文档中的内容。

法律名词及注释:本文档所涉及的法律名词及其注释如下:1:主机名:指路由器的主机标识名称,用于在网络中识别路由器。

2:用户名和密码:用于登录和管理路由器的凭证信息。

3: IP 地址:网络协议中用于唯一标识设备的数字地址。

4:子网掩码:用于标识 IP 地址中网络部分和主机部分的分界线。

5:默认网关:用于转发网络流量的下一跳路由器。

6:以太网接口:用于连接局域网设备的物理接口。

7:串行接口:用于连接广域网设备的物理接口。

8:子接口:在一个物理接口上创建多个逻辑接口,用于实现VLAN 分隔等功能。

9:虚拟局域网 (VLAN):用于将局域网划分成多个逻辑网络的技术。

10:静态路由:手动配置的路由表项,用于指定数据包传输的路径。

11:动态路由:根据路由协议动态学习和更新的路由表项,用于自动路由选择。

12: RIP:路由信息协议,一种距离向量路由协议。

cisco命令大全及一些实验

cisco命令大全及一些实验

cisco命令大全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 +密码配置明文密码enable 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 spanniing-tree vlan +vlan号查看VLA怕生成树议show interfaces | exclde/include "bia" (查看:不包括/只包括有关BIA的数据)2. 路由器配置命令ip route+非直连网段+子网掩码+下一跳地址配置静态/默认路由show ip route 查看路由表show protocols 显示出所有的被动路由协议和接口上哪些协议被设置show ip protocols 显示了被配置在路由器上的路由选择协议,同时给出了在路由选择协议中使用的定时器等信息router rip 激活RIP协议network +直连网段发布直连网段interface loopback 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. 三层交换机配置命令配置一组二层端口interface 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/2Switch(config-if)# no switchportSwitch(config-if)# ip address 192.20.135.21 255.255.255.0Switch(config-if)# no shutdown配置VLANconfigure terminal 进入配置状态vlan vlan-id 输入一个VLAN号, 然后进入vlan配态,可以输入一个新的VLAN号或旧的来进行修改。

思科命令大全(完整版)

思科命令大全(完整版)

思科交换机命令大全1.设置主机名/系统名IOS:switch(config)# hostname "hostname"CLI:switch(enable) set system name name-string2.设置登录口令IOS:switch(config)# enable password level 1 passwordCLI:switch(enable) set passwordswitch(enable) set enalbepass3.设置远程访问IOS:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-addressCLI:switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway4.启用和浏览CDP信息IOS:switch(config-if)# cdp enableswitch(config-if)# no cdp enableCLI:switch(enable) set cdp {enable|disable} module/port5.查看Cisco邻接设备的CDP通告IOS:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail]CLI:switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail] 6.端口描述 IOS:switch(config-if)#description escription-stringCLI:switch(enable)set port name module/number description-string7.设置端口速度IOS:switch(config-if)# speed{10|100|auto}CLI:switch(enable) set port speed moudle/number {10|100|auto}switch(enable) set port speed moudle/number {4|16|auto}8.设置以太网的链路模式IOS:switch(config-if)# duplex {auto|full|half}CLI:switch(enable) set port duplex module/number {full|half}9.配置静态VLANIOS:switch# vlan databaseswitch(vlan)# vlan vlan-num name vlaswitch(vlan)# exitswitch# configure teriminalswitch(config)#interface interface module/numberswitch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-numswitch(config-if)# endCLI:switch(enable) set vlan vlan-num [name name]switch(enable) set vlan vlan-num mod-num/port-list10.配置VLAN中继线IOS:switch(config)# interface interface mod/portswitch(config-if)# switchport mode trunkswitch(config-if)#switchport trunk encapsulation {isl|dotlq}switch(config-if)# switchport trunk allowed vlan remove vlan-listswitch(config-if)# switchport trunk allowed vlan add vlan-list CLI:switch(enable)set trunk module/port [on|off|desirable|auto|nonegotiate] Vlan-range [isl|dotlq|dotl0|lane|negotiate]11.配置VTP管理域IOS:switch# vlan databaseswitch(vlan)# vtp domain domain-nameCLI:switch(enable) set vtp [domain domain-name]12.配置VTP 模式IOS:switch# vlan databaseswitch(vlan)# vtp domain domain-nameswitch(vlan)# vtp {sever|cilent|transparent}switch(vlan)# vtp password passwordCLI:switch(enable) set vtp [domain domain-name][mode{ sever|cilent|transparent }][password password]13.配置VTP版本IOS:switch# vlan databaseswitch(vlan)# vtp v2-modeCLI:switch(enable) set vtp v2 enable14.启动VTP剪裁IOS:switch# vlan databaseswitch(vlan)# vtp pruningCLI:switch(enable) set vtp pruning enable15.配置以太信道IOS:switch(config-if)# port group group-number [distribution {source|destination}] CLI:switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto} 16.调整根路径成本IOS:switch(config-if)#spanning-tree [vlan vlan-list] cost costCLI:switch(enable)set spantree portcost moudle/port costswitch(enable)set spantree portvlancost moudle/port [cost cost][vlan-list] 17.调整端口IDIOS:switch(config-if)#spanning-tree[vlan vlan-list]port-priority port-priority CLI:switch(enable)set spantree portpri {mldule/port}priorityswitch(enable)set spantree portvlanpri {module/port}priority [vlans]18.修改STP时钟IOS:switch(config)# spanning-tree [vlan vlan-list] hello-time secondsswitch(config)#spanning-tree [vlan vlan-list] forward-time secondsswitch(config)#spanning-tree [vlan vlan-list] max-age seconds CLI:switch(enable) set spantree hello interval[vlan]switch(enable) set spantree fwddelay delay [vlan]switch(enable) set spantree maxage agingtiame[vlan]19.启用或禁用Port Fast 特征IOS:switch(config-if)#spanning-tree portfastCLI:switch(enable)set spantree portfast {module/port}{enable|disable}20.启用或禁用UplinkFast 特征IOS:switch(config)#spanning-tree uplinkfast [max-update-rate pkts-per-second]CLI:switch(enable)set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocolsoff|on] 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name21. 为了从一条中继链路上删除VLAN,可使用下列命令:switch(enable) clear trunk module/port vlan-range22. 用show vtp domain 显示管理域的VTP参数.23. 用show vtp statistics显示管理域的VTP参数.24. 在Catalyst交换机上定义TrBRF的命令如下:switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}] 25. 在Catalyst交换机上定义TrCRF的命令如下:switch (enable) set vlan vlan-num [name name] type trcrf {ring hex-ring-num|decring decimal-ring-num} parent vlan-num26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:switch(enable) set vlan vlan-num mod-num/port-num27. 命令show spantree显示一个交换机端口的STP状态.28. 配置一个ELAN的LES和BUS,可以使用下列命令:ATM (config)# interface atm number.subint multiointATM(config-subif)# lane serber-bus ethernet elan-name29. 配置LECS:ATM(config)# lane database database-nameATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-addressATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-addressATM(lane-config-databade)# name ...30. 创建完数据库后,必须在主接口上启动LECS.命令如下: ATM(config)# interface atm numberATM(config-if)# lane config database database-nameATM(config-if)# lane config auto-config-atm-address31. 将每个LEC配置到一个不同的ATM子接口上.命令如下:ATM(config)# interface atm number.subint multipointATM(config)# lane client ethernet vlan-num elan-num32. 用show lane server 显示LES的状态.33. 用show lane bus显示bus的状态.34. 用show lane database显示LECS数据库可内容.35. 用show lane client显示LEC的状态.36. 用show module显示已安装的模块列表.37. 用物理接口建立与VLAN的连接:router# configure terminalrouter(config)# interface media module/portrouter(config-if)# description description-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown38. 用中继链路来建立与VLAN的连接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulation[isl|dotlq] vlan-numberrouter(config-if)# ip address ip-address subnet-mask39. 用LANE 来建立与VLAN的连接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-maskrouter(config-if)# lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-namerouter(config-if)# ...40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行:router(config)# ip routingrouter(config)# router ip-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number41. 配置默认路由: switch(enable) set ip route default gateway42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令:router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num43. 在路由处理器启用MLSP: router(config)# mls rp ip44. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name45. 查看指定的VTP域的信息: router# show mls rp vtp-domain vtp domain name46. 要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mls rp management-interface47. 要检验MLS-RP的配置情况: router# show mls rp48. 检验特定接口上的MLS配置:router# show mls rp interface interface number49. 为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:set mls flow [destination|destination-source|full]50. 为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)# mls rp ip input-acl51. 当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:switch(enable) set mls enable52. 若想改变老化时间的值,可在特权模式下输入以下命令:switch(enable) set mls agingtime agingtime53. 设置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold54. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:switch(enable) show mls include55. 显示MLS高速缓存记录: switch(enable) show mls entry56. 用命令show in arp显示ARP高速缓存区的内容。

思科设备命令及实验大全

思科设备命令及实验大全

一:基本操作命令一:加密命令1. Enable secret 123 (用户进入特权模式时,需要输密码,密文加密形式)2. Enable password 123 (同理,不过密码是明文)3.line consle 0 login password 123 (给用户登录加密)4. service password-enveryption (将所有密码加密成密文形式)5. line vty 0 4 (回车)login password 123 (给远程登录加密)二:查看命令1.show running-config (查看当前设置)2.show history (查看过去使用过的命令)3.show version (查看寄存器的值,版本等)4.show interface (查看接口信息)5.show ip interface (显示接口是否开启)6.show interface serial 0 (显示串口的信息)7.show vlan-switch (查看关于vlan的配置)8.show controllers s0/0 (查看本串口是dte还是dce)9.show vtp status (查看vtp的信息)10.show vlan (查看是否学习到vlan)11.show frame-relay map (查看祯中继的值)12.show sparming-tree (查看生存树的信息)三:一些必备的设置1.line console 0 (回车)logging synchronous (日志同步)2.exec-timeout 0 0 (永不超时)3.no ip domain lookup (关闭dns查找)4.hostname 123 (为设备改名字)5.copy running-config startup-config (将当前配置保存到内存中,防止突然断电使用)四:路由和网关1.ip route 0.0.0.0 0.0.0.0 (为设备设置默认路由)2.ip default-gateway 192.168.1.1 (设置网关)3.bandwidth 64(KB)(设置带宽)4.ip name-server 202.102.152.3 (设定DNS,最多可指定6个DNS)二:具体重要试验一:vlan (交换机)1.vlan database2.vlan 2(2—1001的任何数字)3.interface fastethere 1 (进入接口模式)4.swithport mode access5.swithport access vlan 26.no shutdown (开启接口)目的:将一个物理的LAN,逻辑的划分为不同的VLAN,每一个VLAN都包含着一组工作机站,这样便可以控制流量,减少设备投资,简化网络管理,提高网络的安全性。

思科路由网络通信技术实验指令汇总

思科路由网络通信技术实验指令汇总

网络实验指令汇总一、配置Cisco交换机二、配置VLAN三、Cisco VTP和非VTP中继四、STP生成树协议五、无线路由配置六、配置单个路由器七、静态路由八、配置动态路由RIP九、Cisco EIGRP(增强型内部网关路由协议)十、配置单区域OSPF十一、路由器实现Vlan间通信(单臂路由)十二、PPP(数据链路层协议)十三、ACL简单的配置十四、使用 Easy IP 配置 DHCP(DNS服务器)十五、利用NAT 扩展网络一、配置Cisco交换机设置访问口令switch(config)#enable password 设置进入特权模式进的密码switch(config-line) 可以设置通过console端口连接设备及telnet远程登录时所需要的密码S1#configure terminalS1(config)#line console 0S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#line vty 0 15S1(config-line)#password ciscoS1(config-line)#loginS1(config-line)#exit设置命令模式口令将使能加密口令设置为class:S1(config)#enable secret class配置IP地址及默认网关管理MAC地址表switch#show mac-address-table显示MAC地址列表s witch#clear mac-address-table dynamic清除动态MAC地址列表配置端口安全switch(config-if)switchport port-securityswitch(config-if)switchport port-security maximum 4配置端口在发生端口安全违规事件时自动关闭:如果不配置以下命令,则S1 只会将违规事件登记在端口安全性统计信息中,而不会关闭端口。

思科交换机路由器命令大全

思科交换机路由器命令大全

思科交换机路由器命令大全思科交换机和路由器命令大全本文档为思科交换机和路由器命令的最新最全范本,供参考使用。

以下是详细的命令列表,包括每个命令的说明和用法。

一、接口配置命令1、ip address:设置接口的IP地质示例:ip address 192.168.1.1 255.255.255:02、no shutdown:启用接口示例:no shutdown3、duplex:设置接口的双工模式示例:duplex auto4、speed:设置接口的速度示例:speed 1005、exit:退出接口配置模式示例:exit二、VLAN命令1、vlan database:进入VLAN数据库模式示例:vlan database2、vlan id name:创建VLAN并设置名称示例:vlan 10 name VLAN-103、vlan id:删除VLAN示例:no vlan 104、show vlan:显示VLAN信息示例:show vlan5、exit:退出VLAN数据库模式示例:exit三、路由命令1、ip route:设置静态路由示例:ip route 192.168.2:0 255.255.255:0 192.168.1.22、router rip:启用RIP路由协议示例:router rip3、network:将网络添加到RIP路由表中示例:network 10:0:0:04、redistribute:将静态路由或其他路由协议添加到RIP路由表中示例:redistribute static5、exit:退出路由配置模式示例:exit四、ACL命令1、access-list:创建标准或扩展ACL示例:access-list 10 permit 192.168.1:0 0:0:0.2552、ip access-group:应用ACL到接口示例:ip access-group 10 in3、show access-lists:显示ACL信息示例:show access-lists4、exit:退出ACL配置模式示例:exit五、SNMP命令1、snmp-server community:设置SNMP团体字符串示例:snmp-server community public RO2、snmp-server enable traps:启用SNMP陷阱示例:snmp-server enable traps3、snmp-server host:配置SNMP陷阱接收主机示例:snmp-server host 192.168.1.1004、exit:退出SNMP配置模式示例:exit六、SSH命令1、ip ssh version:设置SSH协议版本示例:ip ssh version 22、crypto key generate rsa:RSA密钥对示例:crypto key generate rsa3、username:创建新的本地用户示例:username admin privilege 15 password password1234、exit:退出SSH配置模式示例:exit七、其他命令1、show running-config:显示当前配置示例:show running-config2、copy running-config startup-config:将当前配置保存到启动配置中示例:copy running-config startup-config3、reload:重新启动设备示例:reload4、exit:退出CLI命令行模式示例:exit本文档涉及附件:1、无附件本文所涉及的法律名词及注释:1、ACL(Access Control List):访问控制列表,用于控制网络流量的进出。

干货!思科网络设备配置命令大全

干货!思科网络设备配置命令大全

干货!思科网络设备配置命令大全础配置1思科设备管理基础命令enable 从用户模式进入特权模式configure terminal 进入配置模式interface g0/0进入千兆以太网接口g0/0ip address 172.16.0.1 255.255.0.0配置接口的 ip 地址no shutdown 开启接口line vty 0 4进入虚拟终端 vty 0 - vty 4password CISCO配置认证密码login 用户要进入路由器,需要先进行登录exit 退回到上一级模式enable password CISCO配置进入特权模式的密码,密码不加密end 直接回到特权模式show int g0/0 显示 g0/0 接口的信息hostname Terminal-Server 配置路由器的主机名enable secret ccielab 配置进入特权模式的密码,密码加密no ip domain-lookup 路由器不使用 DNS 服务器解析主机的 IP地址logging synchronous 路由器上的提示信息进行同步,防止信息干扰我们输入命令no ip routing 关闭路由器的路由功能ip default-gateway 10.1.14.254 配置路由器访问其他网段时所需的网关show line 显示各线路的状态line 33 48 进入 33-48 线路模式transport input all 允许所有协议进入线路int loopback0 进入 loopback0 接口ip host R1 2033 1.1.1.1 为 1.1.1.1 主机起一个主机名alias exec cr1 clear line 33 为命令起一个别名privilege exec level 0 clear line把命令 clear line 的等级改为 0,在用户模式下也可以执行它banner motd 设置用户登录路由器时的提示信show ip int brief 查看接口状态2VLAN相关命令vlan X 创建VLAN Xname SPOTO 将VLAN X命名为SPOTOexit 退出当前模式interface e0/0 进入以太网接口e0/0switchport mode access 将二层接口设置为接入模式switchport access vlan X 将接口划入vlan Xinterface e0/1switchport trunk encapsulation dot1q trunk链路封装协议为 802.1qswitchport mode trunk 将二层接口配置模式为 trunkswitchport trunk allow vlan X trunk接口单独放行某个 vlan。

cisco思科命令大全

cisco思科命令大全

思科命令大全思科常用命令大权1用户模式2:特权模式enableshow vlanshow versionshow interfaceshow mac-address-tableshow running-configcopy running-config startup-config3:全局配置模式config terminalhostnameenable passwordip default-gateway4:接口配置模式interface 端口switchport mode trunk5:line模式line console 0第2章交换机的基本配置1.配置主机hostname2.查看交换机的配置show running-config使能口令enable password加密保存的使能口令enable secret配置IP地址interface vlan1ip addressno shutdown配置交换机的网关ip default-gateway ipaddress查看交换机的MAC地址表show mac-address-table使用CDP协议show cdpshow cdp interfaceshow cdp neighborsshow cdp neighbors detailshow cdp traffic保存与删除交换机配置copy running-config startup-config第三章:虚拟局域网(VLAN)VLAN的概述VLAN是对连接在第2层交换机端口的网络用户的逻辑分段。

VLAN的作用:1。

广播控制2。

安全(副产品)3。

带宽利用4。

延迟VLAN的种类静态:基于端口的VLAN动态:基于MAC地址的VLAN在交换机上配置静态VLAN创建VLAN1。

CONFIG TERMINALVLAN 2NAME 22。

特权模式下VLAN DATABASEVLAN 2 NAME 2查看VLANSHOW VLAN删除VLANNO VLAN 2验证:SHOW VLAN BRIEF在VLAN中添加端口INTERFACE F0/2INTERFACE RANGE F0/2 - 5SWITCHPORT MODE ACCESSSWITCHPORT ACCESS VLAN 2VLAN配置实例在交换机上添加VLAN2,VLAN3,VLAN3,端口范围分别为1-4,5-8,9-12这个实例的作用就是让不同的VLAN的计算机之间的通信隔开。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

一:基本操作命令一:加密命令1. Enable secret 123 (用户进入特权模式时,需要输密码,密文加密形式)2. Enable password 123 (同理,不过密码是明文)3.line console 0 login password 123 (给用户登录加密)4. service password-encryption (将所有密码加密成密文形式)5. line vty 0 4 (回车)login password 123 (给远程登录加密)二:查看命令1.show running-config (查看当前设置)2.show history (查看过去使用过的命令)3.show version (查看寄存器的值,版本等)4.show interface (查看接口信息)5.show ip interface (显示接口是否开启)6.show interface serial 0 (显示串口的信息)7.show vlan-switch (查看关于vlan的配置)8.show controllers s0/0 (查看本串口是dte还是dce)9.show vtp status (查看vtp的信息)10.show vlan (查看是否学习到vlan)11.show frame-relay map (查看祯中继的值)12.show sparming-tree (查看生存树的信息)三:一些必备的设置1.line console 0 (回车)logging synchronous (日志同步)2.exec-timeout 0 0 (永不超时)3.no ip domain lookup (关闭dns查找)4.hostname 123 (为设备改名字)5.copy running-config startup-config (将当前配置保存到内存中,防止突然断电使用)四:路由和网关1.ip route 0.0.0.0 0.0.0.0 (为设备设置默认路由)2.ip default-gateway 192.168.1.1 (设置网关)3.bandwidth 64(KB)(设置带宽)4.ip name-server 202.102.152.3 (设定DNS,最多可指定6个DNS)二:具体重要试验一:vlan (交换机)1.vlan database2.vlan 2(2—1001的任何数字)3.interface fastethere 1 (进入接口模式)4.swithport mode access5.swithport access vlan 26.no shutdown (开启接口)目的:将一个物理的LAN,逻辑的划分为不同的VLAN,每一个VLAN都包含着一组工作机站,这样便可以控制流量,减少设备投资,简化网络管理,提高网络的安全性。

二:trunk (二层设备皆可)1.interface fastethere 12.swithport3.swithport trunk en(tab)dot1q4.swithport mode trunk目的:开启trunck后,能够实现不同VLAN之间的相互通信。

不同VLAN之间是不可以互相通信的。

三:vtp (交换机)一:服务器(在本机首先建立若干个VLAN)1.vlan database2.vlan domain wnt (首先设置域)3.vlan password 123 (设置域的密码)4.vtp pruning (开启vtp修剪)5.vtp v2-mode(版本号)6.vlan server (服务器模式)二:客户机7.vlan database8.vlan domain wnt (首先设置域)9.vlan password 123 (设置域的密码)10.vtp pruning (开启vtp修剪)11.vtp v2-mode(版本号)12. vlan cliant(客户机模式)13.(show vlan 查看是否学习到VLAN)目的:动态的管理VLAN,应用于机器较多的大型网络中,其中透明模式,不可以学习,但可以转发。

四:以太网通道(交换机,所需设备PC1 PC2 SW1 SW2 交换版)一:sw11.interfance fastether 12.speed 100 (设置速度)3.puplex full (全双工)4.channel-group 1 mode on (开启以太网通道)5.no shutdown二:sw21. interface fastethrter 22. speed 100 (速度)3.duplex full (全双工)4.channel-group 1 mode on (开启以太网通道)5.no shutdown(查看以太网通道:show ethcrchnannel 1 brief ,用PC1和pc2进行扩展ping,查看是否丢包)目的:多条线路组合成一条逻辑电路,如一条100M的建立两条的话,那便是200M。

三:路有协议一:rip1.interface fasteternet 1router ripwork 192.168.1.0 (宣告网段,本机器的)3.no auto-summary (取消自动汇总)4.ip summary-address rip 192.168.1.0 (手工汇总)5.clear ip route * (清空路有表,重新收敛)6.ip rip send version 1 2 (收v1和v2)7.ip rip receive version 1 2 (发v1和v2)8.RIP分为ripv1和ripv2,其中ripv1的广播地址是255.255.255.0 ripv2的组播地址是224.0.0.9目的:rip是以跳数为度量值的距离矢量协议他的默认管理距离是120,端口为520,不同的路由器应该使用相同的路由协议,否则就无法进行通信。

Ripv2是rip的增强版。

Ripv1只支持有类的路由,是同类协议中较差的一种协议。

二:eigip1.interface fasteternet 12.router eigip 1 (1-65535的任意整数)work 192.168.2.0 (宣告本机器上的网段)4.bandwidth 100 (定义带宽,以kb为单位)5.no auto-summary (取消自动汇总)6.ip summary-address 192.168.2.0 (手动汇总)7.show ip protocols (显示路由协议的配置情况)8.show ip route eigip (显示路有表中有关eigip的条目)目的:eigip是基于链路状态和距离矢量优点为一体的混合协议,他在同类协议中是比较完善的一种协议。

三:ospf1.interface fasteternet 12.router ospf 1 (1-65535的任意整数)work 192.168.3.0 0.0.0.255 area 0(宣告本机的网段,子网必须是反码,区域应该相同)4.show ip route ospf (查看有关ospf的信息)5.show ip ospf interface (验证接口是否被配置到目标区域了)四:路由重分布(实现不同协议之间的相互通信)如图所示在R1 和R2上运行rip协议,而在R4上运行eigip协议。

其中R3是边界路由器,它运行rip和eigip两个协议。

1.R1 在fa0/1运行rip 宣告192.168.1.02.R2 在e1/0 运行rip 宣告192.168.2.03.R3 在e1/0 运行rip 宣告192.168.2.0 在e1/1 运行eigip 宣告192.168.6.04.R4 在fa0/0 运行eigip 宣告192.168.6.05.在边界路由器上进行路由重分布6.进入:router rip (把eigip分布到rip中)7.redistribute eigip metric 68.进入:router eigip (把rip分布到eigip中)9.redistribute rip metic 10000 20 20 20 20(带宽,延迟,可靠性,负载,最大传输单元)五:子接口(给子接口设ip)1.interface fastether 0/12.no ip address3.no shutdown4.interface fastethere 01/.15.encapsulation dot1q 16.ip address 192.168.2.1 255.255.255.07.no shutdown(一个子接口对应着一个ip地址,一个物理接口可以划分为多个子接口)六:ppp(pap,chap一种封装协议)一:单向的pap(r1和r4)R1:ername R4 password 1232.interface s1/23.ip address 192.168.1.1 255.255.255.04.encapsulation ppp (封装ppp)5.ppp authentication pap (验证类型是pap)6.no shutdownR4:1.interface s1/12.ip address 192.168.1.2 255.255.255.03.encapsulation ppp (封装ppp)4.ppp pap sent-username r4 password 1235.no shutdown二:单向的chapR1:ername R2 password 1238.interface s1/29.ip address 192.168.1.1 255.255.255.010.encapsulation ppp (封装ppp)11.ppp authentication chap (验证类型是pap)12.no shutdownR2:6.interface s1/17.ip address 192.168.1.2 255.255.255.08.encapsulation ppp (封装ppp)9.ppp chap hostname r210.ppp chap password 12311.no shutdown(R1和R4可以相互ping通)二:双向的pap(r1和r4)R1:1.username R4 password 12313.interface s1/214.ip address 192.168.1.1 255.255.255.015.encapsulation ppp (封装ppp)16.ppp pap sent-username R1 password 123 (注意,是本机名和密码!!!!)17.ppp authentication pap (验证类型是pap)18.no shutdownR4:ername R1password 12320.interface s1/221.ip address 192.168.1.1 255.255.255.022.encapsulation ppp (封装ppp)23.ppp pap sent-username R4password 123 (注意,是本机名和密码!!!!)24.ppp authentication pap (验证类型是pap)25.no shutdown(双向的chap同理,但没有ppp pap sent-username R1 password 123这些命令)七:访问控制列表一:标准型,(1-99的任意数字)扩展型(100-199)(deny拒绝,permit 允许)(tcp www:80,tcp ftp:21,icmp ping 各种常用的协议和端口)1. access-list 101 deny tcp 127.16.30.0 0.0.0.255 172.168.1.200 0.0.0.255 eq telnet (拒绝172.16.3.0到172.16.1.200的远程登录)(ip access-group 101 应用到接口上!!!)2.access-list 102 permit tcp 172.16.2.0 0.0.0.255 host 172.168.1.200 eq www (允许172.168.2.0到host主机的web服务)(ip access-group 102 应用到接口上!!!)3.access-list 111 permit tcp 172.168.3.0 0.0.0.255 172.16.1.0 0.0.0.255 eq ftp (允许172.168.3.0 到172.16.1.0的ftp登录)4.access-list 111 permit icmp 172.168.3.0 0.0.0.255 172.16.1.0 0.0.0.255 eq ping(允许172.16.3.0到172.168.1.0的ping) (ip access-group 111 应用到接口上!!!!)八:重点——破思科设备的密码一:路由器:1.重启路由器,在60秒内按下CTRL+Break键,进入ROM Moniter模式2.在提示符下输入命令修改配置寄存器的值并重启:rommon1 > confreg 0X2142rommon2 > reset3.选择不进入setup模式,进入特权模式,保存原有配置,更新enable:Router> enableRouter# copy startup-config running-configRouter# config tRouter(config)# enable secret xxxxxx4.把配置寄存器的值改回0X2102,保存当前配置到startup-config,重启路由器:Router(config)#config-register 0X2102Router(config)#exitRouter# copy running-config startup-configRouter# reload二:交换机1.断电→通电(按住mode键,通电,等第一个指示灯熄灭后松开)2.flash-init3.Load-helper4.Rename flash:config .text flash:config.text.old (更改配置文件)5.Dir flash (查看是否更新成功)6.Boot(重起)7.Rename flash:config.Text.old flash:config.text (改回原来文件)8.Dir flash (查看是否更改成功)9.Copy flash:config.Text running-config(拷贝文件)九NAT1. NAT (网络地址转换)2.NAT技术基本原理:在内部网络中使用内部地址,通过NAT把内部地址翻译成合法的IP 地址在Internet上使用,其具体的做法是把IP包内的地址域用合法的IP地址来替换。

相关文档
最新文档