Cisco常用配置命令

合集下载

Cisco配置命令大全

Cisco配置命令大全

Cisco配置命令大全1. switch配置命令(1)模式转换命令用户模式----特权模式,使用命令"enable"特权模式----全局配置模式,使用命令"configt"全局配置模式----接口模式,使用命令"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 atartup 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} 进入组配置状态配置三层端口configureterminal 进入配置状态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。CONFIG TERMINAL
VLAN 2
NAME 2
2。特权模式下
VLAN DATABASE
VLAN 2 NAME 2
查看VLAN
SHOW VLAN
删除VLAN
NO VLAN 2
验证:SHOW VLAN BRIEF
在VLAN中添加端口
INTERFACE F0/2 (单端口添加)
sw1(config)#int vlan 1
sw1(config-if)#ip address 172.16.0.1 255.255.0.0
sw1(config-if)#no shutdown
sw1(config)#ip default-gateway 172.16.0.254
//以上是vlan 1接口上配置了管理地址,接在vlan 1 上的计算机可以直接进行telnet 该地址,为了其他网段的计算机也可以telnet 交换机,
r1#show int g0/0 (查看g0/0接口的mac地址)
(2)步骤2:配置交换机端口安全
sw1(config)#int f0/1
sw1(config-if)#shutdown
sw1(config-if)#switch mode access
//以上命令是把端口改为访问模式,即用来接入计算机
sw1(config-if)#speed (10|100|1000|auto)
//speed命令用来配置交换机的接口速度 10-10mbps 100-100mbps 1000-1000mbps auto-自动监测接口速度
(4)配置管理地址
交换机允许被telnet ,这时需要在交换机上配置一个ip地址,这个地址是在vlan接口上配置的

思科路由器常用配置命令大全

思科路由器常用配置命令大全

思科路由器常用配置命令大全(A-X) Access-enable允许路由器在动态访问列表中创建临时访问列表入口Access-group把访问控制列表(ACL)应用到接口上Access-list定义一个标准的IP ACLAccess-template在连接的路由器上手动替换临时访问列表入口Appn向APPN子系统发送命令Atmsig执行ATM信令命令B 手动引导操作系统Bandwidth 设置接口的带宽Banner motd 指定日期信息标语Bfe 设置突发事件手册模式Boot system 指定路由器启动时加载的系统映像Calendar 设置硬件日历Cd 更改路径Cdp enable 允许接口运行CDP协议Clear 复位功能Clear counters 清除接口计数器Clear interface 重新启动接口上的件逻辑Clockrate 设置串口硬件连接的时钟速率,如网络接口模块和接口处理器能接受的速率Cmt 开启/关闭FDDI连接管理功能Config-register 修改配置寄存器设置Configure 允许进入存在的配置模式,在中心站点上维护并保存配置信息Configure memory 从NVRAM加载配置信息Configure terminal 从终端进行手动配置Connect 打开一个终端连接Copy 复制配置或映像数据Copy flash tftp 备份系统映像文件到TFTP服务器Copy running-config startup-config 将RAM中的当前配置存储到NVRAMCopy running-config tftp 将RAM中的当前配置存储到网络TFTP服务器上Copy tftp flash 从TFTP服务器上下载新映像到FlashCopy tftp running-config 从TFTP服务器上下载配置文件Debug 使用调试功能Debug dialer 显示接口在拨什么号及诸如此类的信息Debug ip rip 显示RIP路由选择更新数据Debug ipx routing activity 显示关于路由选择协议(RIP)更新数据包的信息Debug ipx sap 显示关于SAP〔业务通告协议〕更新数据包信息Debug isdn q921 显示在路由器D通道ISDN接口上发生的数据链路层〔第2层〕的访问过程Debug ppp 显示在实施PPP中发生的业务和交换信息Delete 删除文件Deny 为一个已命名的IP ACL设置条件Dialer idle-timeout 规定线路断开前的空闲时间的长度Dialer map 设置一个串行接口来呼叫一个或多个地点Dialer wait-for-carrier-time 规定花多长时间等待一个载体Dialer-group 通过对属于一个特定拨号组的接口进行配置来访问控制Dialer-list protocol 定义一个数字数据接受器〔DDR〕拨号表以通过协议或ACL 与协议的组合来控制控制拨号Dir 显示给定设备上的文件Disable 关闭特许模式Disconnect 断开已建立的连接Enable 打开特许模式Enable password 确定一个密码以防止对路由器非授权的访问Enable password 设置本地口令控制不同特权级别的访问Enable secret 为enable password命令定义额外一层安全性(强制安全,密码非明文显示)Encapsulation frame-relayCisco的密码是sapEnd 退出配置模式Erase 删除闪存或配置缓存Erase startup-config 删除NVRAM中的内容Exec-timeout 配置EXEC命令解释器在检测到用户输入前所等待的时间Exit 退出所有配置模式或者关闭一个激活的终端会话和终止一个EXECExit 终止任何配置模式或关闭一个活动的对话和结束EXECformat 格式化设备Frame-relay local-dlci 为使用帧中继封装的串行线路启动本地管理接口〔LMI〕Help 获得交互式帮助系统History 查看历史记录Hostname 使用一个主机名来配置路由器,该主机名以提示符或者缺省文件名的方式使用Interface 设置接口类型并且输入接口配置模式Interface 配置接口类型和进入接口配置模式Interface serial 选择接口并且输入接口配置模式Ip access-group 控制对一个接口的访问Ip address 设定接口的网络逻辑地址Ip address 设置一个接口地址和子网掩码并开始IP处理Ip default-network 建立一条缺省路由Ip domain-lookup 允许路由器缺省使用DNSIp host 定义静态主机名到IP地址映射Ip name-server 指定至多6个进行名字-地址解析的服务器地址Ip route 建立一条静态路由Ip unnumbered 在为给一个接口分配一个明确的IP地址情况下,在串口上启动互联网协议〔IP〕的处理过程Ipx delay 设置点计数Ipx ipxwan 在串口上启动IPXWAN协议Ipx maximum-paths 当转发数据包时设置Cisco IOS软件使用的等价路径数量Ipx network 在一个特定接口上启动互联网数据包交换〔IPX〕的路由选择并且选择封装的类型〔用帧封装〕Ipx router 规定使用的路由选择协议Ipx routing 启动IPX路由选择Ipx sap-interval 在较慢的链路上设置较不频繁的SAP〔业务广告协议〕更新Ipx type-20-input-checks 限制对IPX20类数据包广播的传播的接受Isdn spid1 在路由器上规定已经由ISDN业务供给商为B1信道分配的业务简介号〔SPID〕Isdn spid2 在路由器上规定已经由ISDN业务供给商为B2信道分配的业务简介号〔SPID〕Isdntch-type 规定了在ISDN接口上的中央办公区的交换机的类型Keeplive 为使用帧中继封装的串行线路LMI〔本地管理接口〕机制Lat 打开LAT连接Line 确定一个特定的线路和开始线路配置Line concole 设置控制台端口线路Line vty 为远程控制台访问规定了一个虚拟终端Lock 锁住终端控制台Login 在终端会话登录过程中启动了密码检查Login 以某用户身份登录,登录时允许口令验证Logout 退出EXEC模式Mbranch 向下跟踪组播地址路由至终端Media-type 定义介质类型Metric holddown 把新的IGRP路由选择信息与正在使用的IGRP路由选择信息隔离一段时间Mrbranch 向上解析组播地址路由至枝端Mrinfo 从组播路由器上获取邻居和版本信息Mstat 对组播地址多次路由跟踪后显示统计数字Mtrace 由源向目标跟踪解析组播地址路径Name-connection 命名已存在的网络连接Ncia 开启/关闭NCIA服务器Network 把一个基于NIC的地址分配给一个与它直接相连的路由器把网络与一个IGRP的路由选择的过程联系起来在IPX路由器配置模式下,在网络上启动加强的IGRP Network 指定一个和路由器直接相连的网络地址段Network-number 对一个直接连接的网络进行规定No shutdown 打开一个关闭的接口Pad 开启一个X.29 PAD连接Permit 为一个已命名的IP ACL设置条件Ping 把ICMP响应请求的数据包发送网络上的另一个节点检查主机的可达性和网络的连通性对网络的基本连通性进行诊断Ping 发送回声请求,诊断基本的网络连通性Ppp 开始IETF点到点协议Ppp authentication 启动Challenge握手鉴权协议〔CHAP〕或者密码验证协议〔PAP〕或者将两者都启动,并且对在接口上选择的CHAP和PAP验证的顺序进行规定Ppp chap hostname 当用CHAP进行身份验证时,创建一批好似是同一台主机的拨号路由器Ppp chap password 设置一个密码,该密码被发送到对路由器进行身份验证的主机命令对进入路由器的用户名/密码的数量进行了限制Ppp pap sent-username 对一个接口启动远程PAP支持,并且在PAP对同等层请求数据包验证过程中使用sent-username和passwordProtocol 对一个IP路由选择协议进行定义,该协议可以是RIP,内部网关路由选择协议〔IGRP〕,开放最短路径优先〔OSPF〕,还可以是加强的IGRPPwd 显示当前设备名Reload 关闭并执行冷启动;重启操作系统Rlogin 打开一个活动的网络连接Router 由第一项定义的IP路由协议作为路由进程,例如:router rip 选择RIP 作为路由协议Router igrp 启动一个IGRP的路由选择过程Router rip 选择RIP作为路由选择协议Rsh 执行一个远程命令Sdlc 发送SDLC测试帧Send在tty线路上发送消息Service password-encryption 对口令进行加密Setup 运行Setup命令Show 显示运行系统信息Show access-lists 显示当前所有ACL的内容Show buffers 显示缓存器统计信息Show cdp entry 显示CDP表中所列相邻设备的信息Show cdp interface 显示打开的CDP接口信息Show cdp neighbors 显示CDP查找进程的结果Show dialer 显示为DDR〔数字数据接受器〕设置的串行接口的一般诊断信息Show flash 显示闪存的布局和内容信息Show frame-relay lmi 显示关于本地管理接口〔LMI〕的统计信息Show frame-relay map 显示关于连接的当前映射入口和信息Show frame-relay pvc 显示关于帧中继接口的永久虚电路〔pvc〕的统计信息Show hosts 显示主机名和地址的缓存列表Show interfaces 显示设置在路由器和访问服务器上所有接口的统计信息Show interfaces 显示路由器上配置的所有接口的状态Show interfaces serial 显示关于一个串口的信息Show ip interface 列出一个接口的IP信息和状态的小结Show ip interface 列出接口的状态和全局参数Show ip protocols 显示活动路由协议进程的参数和当前状态Show ip route 显示路由选择表的当前状态Show ip router 显示IP路由表信息Show ipx interface 显示Cisco IOS软件设置的IPX接口的状态以及每个接口中的参数Show ipx route 显示IPX路由选择表的内容Show ipx servers 显示IPX服务器列表Show ipx traffic 显示数据包的数量和类型Show isdn active 显示当前呼叫的信息,包括被叫号码、建立连接前所花费的时间、在呼叫期间使用的自动化操作控制〔AOC〕收费单元以及是否在呼叫期间和呼叫结束时提供AOC信息Show isdn status 显示所有isdn接口的状态、或者一个特定的数字信号链路〔DSL〕的状态或者一个特定isdn接口的状态Show memory 显示路由器内存的大小,包括空闲内存的大小Show processes 显示路由器的进程Show protocols 显示设置的协议Show protocols 显示配置的协议。

思科命令大全(完整版)

思科命令大全(完整版)

思科命令大全(完整版)1.设置主机名/系统名IOS:witch(config)#hotname"hotname"CLI:witch(enable)etytemnamename-tring2.设置登录口令IOS:witch(config)#enablepawordlevel1pawordCLI:witch(enable)etpawordwitch(enable)etenalbepa3.设置远程访问IOS:witch(config)#interfacevlan1witch(config-if)#ipaddreip-addrenetmakwitch(config-if)#ipdefault-gatewayip-addreCLI:witch(enable)etinterfacec0ip-addrenetmakbroadcat-addre witch(enable)etinterfacec0vlanwitch(enable)etiproutedefaultgateway4.启用和浏览CDP信息IOS:witch(config-if)#cdpenablewitch(config-if)#nocdpenableCLI:witch(enable)etcdp{enable|diable}module/port5.查看Cico邻接设备的CDP通告IOS:witch#howcdpinterface[typemodle/port]witch#howcdpneighbor[typemodule/port][detail]CLI:witch(enable)howcdpneighbor[module/port][vlan|duple某|capabilitie|detail]6.端口描述IOS:witch(config-if)#decriptionecription-tring CLI:witch(enable)etportnamemodule/numberdecription-tring 7.设置端口速度IOS:witch(config-if)#peed{10|100|auto}CLI:witch(enable)etportpeedmoudle/number{10|100|auto}witch(enable)etportpeedmoudle/number{4|16|auto}8.设置以太网的链路模式IOS:witch(config-if)#duple某{auto|full|half}CLI:witch(enable)etportduple某module/number{full|half}9.配置静态VLANIOS:witch#vlandatabaewitch(vlan)#vlanvlan-numnamevlawitch(vlan)#e某itwitch#configureteriminalwitch(config)#interfaceinterfacemodule/numberwitch(config-if)#witchportmodeaccewitch(config-if)#witchportaccevlanvlan-numwitch(config-if)#endCLI:witch(enable)etvlanvlan-num[namename]witch(enable)etvlanvlan-nummod-num/port-lit10.配置VLAN中继线IOS:witch(config)#interfaceinterfacemod/portwitch(config-if)#witchportmodetrunkwitch(config-if)#witchporttrunkencapulation{il|dotlq}witch(config-if)#witchporttrunkallowedvlanremovevlan-litwitch(config-if)#witchporttrunkallowedvlanaddvlan-litCLI:witch(enable)ettrunkmodule/port[on|off|deirable|auto|nonegotiate] Vlan-range[il|dotlq|dotl0|lane|negotiate]11.配置VTP管理域IOS:witch#vlandatabaewitch(vlan)#vtpdomaindomain-nameCLI:witch(enable)etvtp[domaindomain-name]12.配置VTP模式IOS:witch#vlandatabaewitch(vlan)#vtpdomaindomain-namewitch(vlan)#vtp{ever|cilent|tranparent}witch(vlan)#vtppawordpawordCLI:witch(enable)etvtp[domaindomain-name][mode{ever|cilent|tranparent}][pawordpaword] 13.配置VTP版本IOS:witch#vlandatabaewitch(vlan)#vtpv2-modeCLI:witch(enable)etvtpv2enable14.启动VTP剪裁IOS:witch#vlandatabaewitch(vlan)#vtppruningCLI:witch(enable)etvtppruningenable15.配置以太信道IOS:witch(config-if)#portgroupgroup-number[ditribution{ource|detination}]CLI:witch(enable)etportchannelmoudle/port-rangemode{on|off|deirable|auto}16.调整根路径成本IOS:witch(config-if)#panning-tree[vlanvlan-lit]cotcotCLI:witch(enable)etpantreeportcotmoudle/portcotwitch(enable)etpantreeportvlancotmoudle/port[cotcot][vlan-lit]17.调整端口IDIOS:witch(config-if)#panning-tree[vlanvlan-lit]port-priorityport-priorityCLI:witch(enable)etpantreeportpri{mldule/port}prioritywitch(enable)etpantreeportvlanpri{module/port}priority[vlan] 18.修改STP时钟witch(config)#panning-tree[vlanvlan-lit]ma某-ageecondCLI:witch(enable)etpantreehellointerval[vlan]witch(enable)etpantreefwddelaydelay[vlan]witch(enable)etpantreema某ageagingtiame[vlan]19.启用或禁用PortFat特征IOS:witch(config-if)#panning-treeportfatCLI:witch(enable)etpantreeportfat{module/port}{enable|diable}20.启用或禁用UplinkFat特征IOS:witch(config)#panning-treeuplinkfat[ma某-update-ratepkt-per-econd]CLI:witch(enable)etpantreeuplinkfat{enable|diable}[rateupdate-rate][all-protocoloff|on]为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令:witch(config)#cluterenablecluter-name21.为了从一条中继链路上删除VLAN,可使用下列命令:witch(enable)cleartrunkmodule/portvlan-range22.用howvtpdomain显示管理域的VTP参数.23.用howvtptatitic显示管理域的VTP参数.24.在Catalyt交换机上定义TrBRF的命令如下:witch(enable)etvlanvlan-name[namename]typetrbrfbridgebridge-num[tp{ieee|ibm}]25.在Catalyt交换机上定义TrCRF的命令如下:witch(enable)etvlanvlan-num[namename]typetrcrf{ringhe某-ring-num|decringdecimal-ring-num}parentvlan-num26.在创建好TrBRFVLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口:witch(enable)etvlanvlan-nummod-num/port-num27.命令howpantree显示一个交换机端口的STP状态.28.配置一个ELAN的LES和BUS,可以使用下列命令:ATM(config)#interfaceatmnumber.ubintmultiointATM(config-ubif)#laneerber-buethernetelan-name29.配置LECS:ATM(config)#lanedatabaedatabae-nameATM(lane-config-databade)#nameelan1-nameerver-atm-addrele1-nap-addreATM(lane-config-databade)#nameelan2-nameerver-atm-addrele2-nap-addreATM(lane-config-databade)#name...30.创建完数据库后,必须在主接口上启动LECS.命令如下:ATM(config)#interfaceatmnumberATM(config-if)#laneconfigdatabaedatabae-nameATM(config-if)#laneconfigauto-config-atm-addre31.将每个LEC配置到一个不同的ATM子接口上.命令如下:ATM(config)#interfaceatmnumber.ubintmultipointATM(config)#laneclientethernetvlan-numelan-num32.用howlaneerver显示LES的状态.33.用howlanebu显示bu的状态.34.用howlanedatabae显示LECS数据库可内容.35.用howlaneclient显示LEC的状态.36.用howmodule显示已安装的模块列表.37.用物理接口建立与VLAN的连接:router#configureterminalrouter(config)#interfacemediamodule/portrouter(config-if)#decriptiondecription-tringrouter(config-if)#ipaddreip-addrubnet-makrouter(config-if)#nohutdown38.用中继链路来建立与VLAN的连接:router(config)#interfacemodule/port.ubinterface router(config-ig)#encapulation[il|dotlq]vlan-number router(config-if)#ipaddreip-addreubnet-mak39.用LANE来建立与VLAN的连接:router(config)#interfaceatmmodule/portrouter(config-if)#noipaddrerouter(config-if)#atmpvc105qaalrouter(config-if)#atmpvc2016ilnirouter(config-if)#interfaceatmmodule/port.ubinterfacemultipointrouter(config-if)#ipaddreip-addreubnet-makrouter(config-if)#laneclientethernetelan-numrouter(config-if)#interfaceatmmodule/port.ubinterfacemultipointrouter(config-if)#ipaddreip-addreubnet-namerouter(config-if)#laneclientethernetelan-namerouter(config-if)#...40.为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行:router(config)#iproutingrouter(config)#routerip-routing-protocolrouter(config-router)#networkip-network-numberrouter(config-router)#networkip-network-number41.配置默认路由:witch(enable)etiproutedefaultgateway42.为一个路由处理器分配VLANID,可在接口模式下使用下列命令:router(config)#interfaceinterfacenumberrouter(config-if)#mlrpvlan-idvlan-id-num43.在路由处理器启用MLSP:router(config)#mlrpip44.为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中:router(config)#interfaceinterfacenumberrouter(config-if)#mlrpvtp-domaindomain-name45.查看指定的VTP域的信息:router#howmlrpvtp-domainvtpdomainname46.要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:router(config-if)#mlrpmanagement-interface47.要检验MLS-RP的配置情况:router#howmlrp48.检验特定接口上的MLS配置:router#howmlrpinterfaceinterfacenumber49.为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:etmlflow[detination|detination-ource|full]50.为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:router(config)#mlrpipinput-acl51.当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令:witch(enable)etmlenable52.若想改变老化时间的值,可在特权模式下输入以下命令:54.确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定:witch(enable)howmlinclude55.显示MLS高速缓存记录:witch(enable)howmlentry56.用命令howinarp显示ARP高速缓存区的内容。

cisco路由器常用命令

cisco路由器常用命令

cisco路由器常用命令1、Switch> 用户模式2、Switch>enable 进入特权模式Switch#3、Switch#config terminal 进入全局模式Switch(config)#4、Switch(config)#interface f0/1 进入接口模式Switch(config-if)#5、Switch(config)#line console 0 进入line模式Switch(config-line)#exit 退回上层end 结束所有操作6、Switch(config)#hostname aaa 配置主机名7、switch#show running-config 查看配置情况8、Switch(config)#enable password 111 设置使能密码(明文)9、Switch(config)#enable secret 111 设置使能密码(密文)Switch(config)#line console 0 设置console密码Switch(config-line)#password 333Switch(config-line)#login10、Switch(config)#interface vlan1Switch(config-if)#ip address 192.168.1.1 255.255.255.0 设置IP地址Switch(config-if)#no shutdown11、Switch(config)#ip default-gateway 192.168.1.10 设置网关12、Switch#show mac-address-table 查看MAC地址表13、Switch#show cdp cdp全局配置信息14、Switch#show cdp interface f0/1 cdp接口配置信息15、Switch#show cdp traffic cdp包的配置信息16、Switch#show cdp neighbors cdp邻居基本信息17、Switch#show cdp neighbors detail cdp邻居详细信息Switch#show cdp neighbors entry18、Switch#copy running-config startup-config19、Switch#erase startup-config 恢复出厂信息Switch#reload 重新加载20、交换机密码恢复*断开电源*按住MODE键,加电(等待数秒)*switch:出现此符号*switch:flash_init 初始化flash*switch:dir flash: (查看文件,可省去)*switch:rename config.text config.old 改名*switch:boot 重启*switch>enable 进入特权*switch#dir flash: (查看文件,可省去)*switch#rename config.old config.text改名*switch#copy flash:config.text running-config 复制到系统内*switch#confit terminal 进入全局模式*switch(config)#enable password 222 设置新密码21、switch#show vlan-sw brief 查看vlan22、switch#vlan database 进入vlan模式switch(vlan)#vlan 20 name bbb 创建vlan并命名23、switch(vlan)#no vlan 20 删除vlan24、添加端口到vlan(单个)switch(config)#interface f0/1 进入接口模式switch(config-if)#switchport access vlan 10 添加至vlan10switch(config-if)#end 退出switch#show vlan brief (id) 验证vlanswitch(config)#show running-config interface f0/1(查看某接口)25、添加端口到vlan(批量)switch(config)#interface range f0/1 - 5switch(config-if-range)#switchport access vlan 1026、switch(config)#interface f0/1 进入接口switch(config-if)#switchport mode trunk 设置为trunk(永久)switch(config-if)#switchport mode dynamic desirable/auto(其它trunk)switch(config-if)#switchport trunk allowed vlan remove 10 移除vlan10)switch(config-if)#switchport trunk allowed vlan add 20 添加vlan2027、switch#show interface f0/1 switchport 查看接口模式show ip interface briefSwitch#write 保存交换机配置信息。

学习笔记-cisco常用命令

学习笔记-cisco常用命令

学习笔记-cisco常⽤命令打开模拟器,进⼊命令⾏模式:(⼀)⽤户模式(>):⽤户模式仅能进⾏少量查看操作问号在操作系统中有帮助作⽤展⽰内容时,more代表有更多内容,按回车多展⽰⼀⾏,按空格多展⽰⼀屏内容(⼏⾏可以在特权模式活全局配置模式设置),tab键退出查看(⼆)特权模式在⽤户模式输⼊enable进⼊特权模式(#)disable退出特权模式(三)全局配置模式(只有特权模式才能进⼊全局配置模式)在特权模式输⼊#configure terminal进⼊全局模式,exit退出(四)快捷键tab键补齐命令ctrl+a光标移⾄最左ctrl+e光标移⾄最右ctrl+u此⾏内容全部删除Ctrl+shift+6打断当前操作Ctrl+c放弃当前所有操作退回特权模式(五)命令全局模式下修改设备名字hostname 名字查看配置show running-config特权模式保存配置⽂件:copy running-config starup-congfig或者write查看历史记录#show history进⼊全局模式配置ip地址选择相应接⼝:int e0/1配置IP:ip address 10.1.100.1 255.255.255.0开启接⼝:no shutdown配置⽹络设备远程登录,使⽤Telnet程序配置第0个线程配置0-2三个线程登录,密码cisco设置Telnet程序:transport input telnet退出:end连接#telnet 10.1.100.254 输⼊密码,连接成功如果没有配置特权密码的情况下,Telnet远程登录上来是⽆法提升权限的配置特权密码enable password cisco登出:logout退出telnet:q(代表quit)或者exitno ip routing//关闭路由器的路由功能,模拟PCip default-gateway 172.16.1.1 为模拟PC的略由器配置⼀个默认⽹关配置⼀条静态路由Branch(config)#ip route 172.16.1.0 255.255.255.0 e0/1 192.168.1.1//告诉路由器,去往172.16.1.0/24这个⽹络应该将数据从e0/1接⼝转发出去,交给192.168.1.1这个设备删除静态路由no ip route 172.16.1.0 255.255.255.0 e0/1 192.168.1.1$ 172.16.1.0 255.255.255.0 e0/1 192.168.1.1邻居设备发现功能#Show cdp neighbors邻居设备详细信息show cdp neighbors detail查看Mac地址表:show mac address-tableVLAN划分:基于接⼝的VLAN划分1)创建⼀个VLAN #vlan 100然后exit退出(不退出不⽣效)2)配置基于端⼝的VLAN,将⼀个端⼝指派到VLAN 100#switchport mode access将⼀个端⼝指定为access(访问模式)⼯作模式#switchport access vlan 100 将这个端⼝划分进vlan100的端⼝组查看VLAN摘要信息修改信息进⼊全局模式,进⼊VLAN 100,更改名称name 名字,退出exit,⽣效VLAN范围正常情况是1-4094(由12个bit定义VLAN)1002-1005是保留VLAN1000以内是基础VLAN查看vlan信息:#Show vlan id 100关闭某个vlan shutdown vlan 100Show interfaces e0/0 switchport配置trunkSWl(config-if)#switchport trunk encapsulation dot1q//指定为802.1q封装SW1(config-if)#switchport mode trunk//⼿⼯指定接⼝为trunk⼯作模式查看DTP 动态trunk协议主要⽤于在交换机之间动态的协商端⼝⼯作模式SW1(config-if)#switchport mode dynamic ? //配置接⼝动态协商trunkauto Set trunking mode dynamic negotiation parameter to AUTOdesirable Set trunking mode dynamic negotiation parameter to DESIRABLE #vtp mode 模式设置vtp模式#show vtp status 检查vtp⼯作状态#vtp password cisco 配置⼀个密码show spanning-tree vlan 1 检查⽣成树状态SW2(config)#spanning-tree vlan 1 priority 0 调整⽣成树的优先级switchport trunk allowed vlan ? 调整trunk端⼝允许通过的vlan配⼀组端⼝ interface range e0/2-3配置之前要 shutdownswitchport trunk encapsulation dot1qswitchport mode trunk配置LACP channel-group 1 mode activeSW2(config-if-range)#no shutdown 先开启被动⼀端,再开启主动⼀端清空接⼝配置default interface range e0/2-3配置HSRPstandby配置热备份动态路由协议(HSRP)先配置接⼝IP地址,开启接⼝Standby 后⾯跟组号码配置⼀个虚拟IP地址命令:standby 1 ip 10.1.1.11查看配置:show standby brief查看信息show standby配置优先级 standby 1 priority 150 (值越⼤越优先,默认100)抢占:standby 1 preempt配置:先配置交换机之间接⼝,配置trunk创建两个vlan 100和200Vtp mode server通过域名定义VTP的管理域Vtp domain(域)名称交换机就学习到两个vlanPC1端⼝划分到vlan 100 PC2划分到vlan200将交换机连接路由器的接⼝配置为trunk交换机接⼝默认开启不需要shutdown为PC配置IP地址和默认⽹关为路由器配置⼦接⼝,先开启物理接⼝,创建两个⼦接⼝标记当前⼦接⼝监测来⾃e0/0接⼝的数据,并且处理携带802.1q标记为vlan100的数据配置DHCP服务:关闭⽹关no ip default-gatewayBranch做DHCP服务器定义名字ip dhcp pool 1指定⼦⽹中分配哪些ip地址:地址范围network 10.1.10.0 /24(有空格0 /24)默认⽹关default-router 10.1.10.254租期lease多长时间 infinite永久配置地址查看为哪些主机分配了IP查看地址池信息PC1能够ping通PC2PAP配置配置接⼝地址,配置ppp #encapsulation ppppap认证要求对端向我认证,提供⽤户名密码在本地创建⼀个⽤于认证的数据库Branch(config-if)#ppp pap sent-username branch password cisco //向server端提供⽤户名和密码配置tunnel隧道:先配置ip地址,开启接⼝配置静态路由建⽴隧道E0/0出接⼝⽬的地IP设置私⽹地址查看接⼝配置。

Cisco交换机常用配置命令

Cisco交换机常用配置命令

Cisco交换机常用配置命令1交换机上设置主机名/系统名:switch(config)# hostname hostname2.交换机上设置登录口令:switch(config)# enable password level 1 password3.交换机上设置远程访问:switch(config)# interface vlan 1switch(config-if)# ip address ip-address netmaskswitch(config-if)# ip default-gateway ip-address4在交换机上启用和浏览CDP信息:switch(config-if)# cdp enableswitch(config-if)# no cdp enable为了查看Cisco邻接设备的CDP通告信息:switch# show cdp interface [type modle/port]switch# show cdp neighbors [type module/port] [detail] 5.交换机的端口描述:switch(config-if)# description description-string6.交换机上设置端口速度:switch(config-if)# speed{10|100|1000|auto}7在基于IOS的交换机上设置以太网的链路模式: switch(config-if)# duplex {auto|full|half}在交换机上设置以太网的链路模式:switch(enable) set port duplex module/number {full|half} 8.在交换机上创建VLAN并划入接口switch# configure teriminalswitch(config)# vlan configuration vlan-numswitch(config)# interface interface module/number switch(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-num switch(config-if)# endCisco交换机故障处理●检查端口状态up/downShow ip int brief●查看cpu负载是否过高show processes cpu●检查内存利用率是否过高show processes memory●检查路由表是否正确show ip route 查看系统日志Show log。

cisco命令大全

cisco命令大全

思科命令复习路由器配置视图模式介绍:普通视图 router>特权视图 router# /在普通模式下输入enable全局视图 router(config)# /在特权模式下输入config t接口视图 router(config-if)# /在全局模式下输入int 接口名称例如int s0或int e0路由协议视图 router(config-route)# /在全局模式下输入router 动态路由协议名称1、基本配置:router>enable /进入特权模式router#conf t /进入全局配置模式router(config)# hostname xxx /设置设备名称就好像给我们的计算机起个名字router(config)#enable password xxx /设置特权口令router(config)#no ip domain lookup /不允许路由器缺省使用DNS解析命令router(config)# Service password-encrypt /对所有在路由器上输入的口令进行暗文加密router(config)#line vty 0 4 /进入设置telnet服务模式router(config-line)#password xxx /设置telnet的密码router(config-line)#login /使能可以登陆router(config)#line con 0 /进入控制口的服务模式router(config-line)#password xxx /要设置console的密码router(config-line)#login /使能可以登陆2、接口配置:router(config)#int s0 /进入接口配置模式 serial 0 端口配置(如果是模块化的路由器前面加上槽位编号,例如serial0/0 代表这个路由器的0槽位上的第一个接口)router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码router(config-if)#enca hdlc/ppp 捆绑链路协议 hdlc 或者 ppp 思科缺省串口封装的链路层协议是HDLC所以在show run配置的时候接口上的配置没有,如果要封装为别的链路层协议例如PPP/FR/X25就是看到接口下的enca ppp或者enca frrouter(config)#int loopback /建立环回口(逻辑接口)模拟不同的本机网段router(config-if)#ip add xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx /添加ip 地址和掩码给环回口在物理接口上配置了ip地址后用no shut启用这个物理接口反之可以用shutdown管理性的关闭接口3、一般的常用命令router(config-if)#exitrouter(config)#router(config-router)#exitrouter(config)#router(config-line)#exitrouter(config)#router(config)#exitrouter#exit命令 /从接口、协议、line等视图模式下退回到全局配置模式,或从全局配置模式退回到特权模式router(config-if)#endrouter(config-router)#endrouter(config-line)#endrouter#end命令 /从任何视图直接回到特权模式router#Logout /退出当前路由器登陆模式相对与windows的注销router#reload /重新启动路由器(热启动)冷启动就是关闭路由器再打开电源开关特权模式下:router#show ip route /查看当前的路由表router#clear ip route * /清楚当前的路由表router#show protocols /显示出所有的被动路由协议和接口上哪些协议被设置router#show ip protocol /查看当前路由器运行的动态路由协议情况router#show ip int brief /查看当前的路由器的接口ip地址启用情况router#show running-config /查看当前运行配置router#show startup-config /查看启动配置router#debug ip +协议 /动态查看路由更新信息router#undebug all /闭所有DEBUG信息router#debug ip pack /打开ip报文的调试router#terminal monitor /输出到终端上显示调试信息router#Show interfaces /显示设置在路由器和访问服务器上所有接口的统计信息. 显示路由器上配置的所有接口的状态router#Show interfaces serial /显示关于一个串口的信息router#Show ip interface /列出一个接口的IP信息和状态的小结, 列出接口的状态和全局参数4、路由配置:(1)静态路由router(config)#ip route xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx xxx/目标网络和掩码还有下一跳地址router(config)#ip route 0.0.0.0 0.0.0.0 s 0 添加缺省路由(2)动态路由rip协议router(config)#router rip /启动rip协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#version 2 转换为rip 2版本,默认是rip 1版本router(config-router)#no auto-summary /关闭自动汇总功能,rip V2才有作用router(config-router)# passive-int 接口名 /启动本路由器的那个接口为被动接口router(config-router)# neighbor xxx.xxx.xxx.xxx /广播转单播报文,指定邻居的接ipigrp协议router(config)#router igrp xxx /启动igrp协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#variance xxx /调整倍数因子,使用不等价的负载均衡eigrp协议router(config)router eigrp xxx /启动协议router(config-router)#network xxx.xxx.xxx.xxx /宣告自己的网段router(config-router)#variance xxx /调整倍数因子,使用不等价的负载均衡router(config-router)#no auto-summary /关闭自动汇总功能router#Show ip eigrp int /查看哪个接口宣告进了EIGRProuter(config-router)#timers active-time 4 /改变或关闭缺省的3min的活动状态计时router#Show ip eigrp nei /查看邻居表router#Show ip eigrp topology /查看拓扑表router#Show ip eigrp topology all-links /查看不是可行后继router#show ip eigrp traffic /查看发送包数量router(config-if)#ip summary-address eigrp 1 192.168.0.0 255.255.240.0 /接口下汇总EIGRP认证:router (config)#key chain ccie /配置密钥的名字router (config-keychain)#key 1 /密钥序列号router (config-keychain-key)#key-string abc /密码router (config)#int s0/0router (config-if)#ip authentication mode eigrp 1 md5 /接口使用md5加密router (config-if)#ip authentication key-chain eigrp 1 ccie /接口调用密钥router (config-keychain-key)#send-lifetime 00:00:00 1 mar 2012 00:00:00 3 mar 2012 /配置密钥的生存时间router (config-router)Paaive-interface s0/1 /被动接口的配置ospf协议router(config)router ospf xxx /启动协议启动一个OSPF协议进程router(config-router)network xxx.xxx.xxx.xxx area xxx /宣告自己的接口或网段在ospf的区域中可以把不同接口宣告在不同区域中router(config-router)router-id xxx.xxx.xxx.xxx /配置路由的idrouter(config-router)aera xxx stub /配置xxx区域为末梢区域加入这个区域的路由器全部要配置这个条命令router(config-router)aera xxx stub no-summary /配置xxx区域为完全末梢区域只在ABR上配置router(config-router)aera xxx nssa /配置xxx区域为非纯末梢区域加入这个区域的路由器全部要配置这个条命令router(config-router)aera xxx nssa no-summary /配置xxx区域为完全非纯末梢区域只在ABR上配置,并发布缺省路由信息进入这个区域内的路由器router #show ip ospf interface /查看哪些接口被宣告进OSPF进程router #show ip ospf int brief /查看接口运行OSPF的简要信息router #show ip ospf neighbor /查看OSPF的邻居表router #show ip protocol /查OSPF配置信息router #show ip ospf /查看完整的OSPF信息router #show ip database /查看OSPF数据库router (config-router)#maximum-paths /修改OSPF的负载均衡条数router (config-router)#Area 1 range 192.168.10.0 255.255.255.0 /区域间的路由汇总router (config-router)#summary-address 192.168.10.0 255.255.255.0 /外部路由汇总router #show run | b router ospf /查看OSPF配置router (config-router)#area 1 default-cost 10 /为BR路由器发送到一个末梢区域的缺省路由指定一个代价值router#clear ip ospf process /清楚当前路由器ospf协议的进程OSPF加密:router (config-if)#ip ospf authentication-key ccnp /接口下配置明文密钥router (config-router)#area 0 authentication /协议下调用明文密钥router (config-if)#ip ospf message-digest-key 1 md5 ccnp /接口下配置MD5密钥router (config-router)#area 0 authentication message-digest /协议下调用MD5密钥5、保存当前修改/运行的配置:router#write /将RAM中的当前配置存储到NVRAM中,下次路由器启动就是执行保存的配置router#Copy running-config startup-config /命令与write效果一样6 ACL配置router(config)#access-list (1~99)(deny/permit)(源地址)(反掩码)(log) /标准访问列表router(config)#access-list (100~199)(deny/permit)(协议)(源地址)(反掩码)(目的地址)(反掩码)(端口号)(log) / 扩展访问列表router(config)#ip access-list {standard | extended(扩展)} ( name ) 命名访问列表router#access-enable /允许路由器在动态访问列表中创建临时访问列表入口router (config-if)#ip access-group xxx /把访问控制列表(ACL)应用到接口上router (config-line)#access-class xxx {in/out} / VTY上调用ACLrouter#show ip access-list /查看aclrouter (config)#access-list / 定义一个标准的IP ACL交换机配置1、基本配置:Switch >enable /进入特权模式Switch#conf t /进入全局配置模式Switch (conf-if)#duplex full/half/auto /有full , half, auto 三个可选switch# erase startup-configure / 恢复出场配置switch# reload / 重启交换机远程登录和con口还有接口配置和路由器配置命令一样,不再下面总结。

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

Cisco常用配置命令2010-09-27 14:43:40标签:Cisco常用配置命令版权声明:原创作品,如需转载,请与作者联系。

否则将追究法律责任。

Cisco常用配置命令一.交换机的基本配置C2950#config terminal 进入全局配置模式show interface fastethernet0/1 查看端口0/1的配置结果show interface fastethernet0/1 status 查看端口0/1的状态show mac-address-table 查看整个MAC地址表clear mac-address-table restricted static 清除限定性地址C2950(config)#hostname 2950A / 设置主机名为2950Ainterface f0/23 / 进入端口23的配置模式enable password cisco / 设置enable password为ciscoenable secret cisco1 / 设置enable secret为cisco1ip address 192.168.1.1 255.255.255.0 / 设置交换机IP地址ip default-gateway 192.168.1.254 / 设置默认网关ip domain-name / 设置域名ip name-server 200.0.0.1 / 设置域名服务器配置查看MAC地址表mac-address-table ?mac-address-table aging-time 100 / 设置超时是时间为100smac-address-table permanent /f0/3 加入永久地址mac-address-table restricted static 0000.0c02.bbcc / f0/6 f0/7 加入静态地址endshow mac-address-table /查看整个Mac地址表clear mac-address-table restricted staticC2950(config-if)#interface fastethernet0/1 /进入接口F0/1子配置模式interface Ethernet0 /进入以太网口0子配置模式no shutdown /激活接口speed ? /查看speed命令的子命令speed 100 /设置该端口速率为100Mb/sdulplex full/half/auto /设置该端口为全双工description TO_PC1 /设置该端口描述为TO_PC1show interface fastethernet 0/1 /查看端口0/1的配置结果show interface fastethernet 0/1 status /查看端口0/1的状态配置VTP和STP一. 配置VTP2950A #vlan database /进入VLAN配置子模式show vtp status /查看VTP设置信息show vlan /查看VLAN配置信息copy running-config startup-config /保存配置文件2950A(vlan)#vtp server/client /设置本交换机为server/client模式vtp pruning /启动修剪功能vtp domain vtpserver /设置域名为vtpservervlan 2 /创建VLAN2,系统将自动命名vlan 3 name vlan3 /创建VLAN3,并命名为vlan3Switch(config-if)#switchport mode trunk /设置当前端口为Trunk模式switchport trunk allowed vlan all /设置允许从该端口交换数据的VLANswitchport trunk vlan remote vlan6 /设置允许交换数据的Vlan(除vlan6外)switchport mode access /设置端口为静态VLAN访问模式switchport access vlan2 /将端口9分配给相信的VLAN2show vlan生成树协议配置(负载均衡)Switch#spanning-tree vlan 1 port-priority 10 /设置VLAN 1的端口的权值为10 (默认值为128)spanning-tree vlan 1 cost 19 /设置VLAN 1生成树路径值为19专题三配置路由协议Router# enableRouter#config terminalRouter(conf)#hostname R1show session /查看终端服务器的会话show line 1 /查看线路1的状态clear line 2 /清除线路2A. 静态路由格式:ip route ip-addr subnet-mask gateway 加入静态路由R1(conf)#ip route 192.168.1.0 255.255.255.0 10.1.1.1ip routing /启动IP路由B. 动态路由(1)配置RIP协议no logging console 防止大量的端口状态变化信息和报警信息对配置过程的影响[no] ip routing 允许/不允许路由选择协议router ri p 进入RIP协议配置模式network 192.168.1.0 声明192.168.1.0与路由器R1直接邻接version 2 设置RIP协议的版本为2neighbor ip-addr 说明邻接路由器,以使它们能够自动更新路由passive interface 接口阻止在指定的接口发送路由更新协议show ip route 查看路由表信息show ip route rip/igrp/ospf 查看RIP/IGRP/OSPF协议路由信息(2)配置IGRP协议no keepalive /不监测keepalive信号,即不连接设备时可激活该接口bandwidth x /设置带宽为x(Kb/s)clockrate x /设置时钟频率为x(HZ)timer basic /更新时间到期时间抑制与否清除时间设置自定义的路由更新时间……no metric holddown /禁止抑制功能,路由信息删除后可立即接受新的metric maximum-hop 50 /当信息包穿过50个路由器时,删除信息包router igrp/eigrp autonomous-system /进入IGRP协议配置子模式(3)配置OSPF协议router ospf 1 /指定使用ospf选择协议,并运行在1号进程中network 网络地址掩码反码 area 区域号 /说明与区域1的172.16.4.6邻接area 区域号 stub /将区域x转化为根区show ip ospf neighbor /列出与本路由器是“邻接”关系的路由器no ospf auto-cost-determination /使OSPF不自动根据每个接口的带宽,计算出其cost ip ospf cost /手动设置接口的costarea 1 range 172.16.4.0 255.255.255.0 /说明区域一的范围是子网172.16.4.0/24 (4)配置EIGRP协议no auto-summary 关闭EIGRP协议的路由自动汇总功能network network-addr 掩码反码广域网接入一.配置ISDNisdn switch-type switch-type /设置交换机类型为 switch-typeinterface bri 0 /进入ISDN的BRI接口配置模式encapsulation ppp /设置封装协议为pppppp multilink /启动ppp多连接dialer string 80000002 /设置拨号串,R2的ISDN号码为80000002dialer-group 1 /设置拨号组号为1,把BRI 0接口与拨号列表1相关联dialer-list 1 protocol ip permit /设置拨号列表1,即当有IP包时将引起拨号dialer load-threshold load /设置达到load后,启动第二个B通道.logging console /在终端上显示监测信息debug dialer /监测dialer信息undebug all /关闭所有调试信息二. 配置PPP和DDRppp authentication chap /设置PPP认证方式为CHAPclockrate speed /设置DCE端线路速度为speeddialer idle-timeout 120 /设置拨号空闲时间为120sno cdp enable /禁止通过此接口传递CDP控制数据dialer map ip 192.168.1.2 name R2 broadcast 800000002/设置拨号串,将IP地址与ISDN的SPID对应起来.usename R2 password secret/设置用户名和口令,即设置拨号链路对端路由器名为R2,口令为secret.三. 配置帧中继frame-relay lmi-type cisco /设置帧中继的LMI类型为ciscono frame-relay inverse-arp /关闭帧中继逆向ARPno ip address /只在数据链路层工作,无需IP地址frame-relay interface-dlci dlciinterface serial 2 /进入串行口2端口配置模式frame-relay route 303 interface Serial 1 302 在串行口2的DLCI 303与串行口1的DLCI 302之间建立关联show frame route /显示完整的路由信息frame-relay map ip 192.168.1.2 302 broadcast /将IP地址192.168.1.2与帧中继的DLCI 302关联起来interface s 0.1 划分子接口,对其进行逻辑划分interface s 0.1 point-to-point 划分子接口,并设置为点对点模式VPN配置一 L2TP的配置与测试A:命令模式:特权用户模式Quidway#(1)show l2tp session 显示当前的L2TP会话的信息举例:Quidway#show l2tp session(2) show l2tp tunnel 显示当前的L2TP通道的信息举例:Quidway#show l2tp tunnel(3)clear vpdn tunnel l2tp remote-name 断开通道对端名称为X的通道连接举例:Quidway#clear vpdn tunnel l2tp A8010B:命令模式:全局配置模式Quidway(config)#(4) [no] vpdn-group group-nunmber 创建/删除组号为x的VPDN组举例:Quidway(config)#vpdn-group 2默认情况:系统默认没有创建VPDN组(5)[no] interface vitual-template vitual-template-number 创建/删除虚接口模块举例:Quidway(config)#interface virtual-template 1默认配置:系统默认没有创建虚接口模块C:命令模式:VPDN组配置模式Quidway(config-vpdn1)#(6) [no]lcp renegotiation 允许/不允许LCP再次协商举例:Quidway(config-vpdn1)#lcp renegotiation扩展:lcp renegotiation always 一直允许进行LCP协商默认情况:系统默认不重新进行LCP协商(7)local name name 指定通道本端的名称为nameno local name 将通道本端的名称恢复成默认名称举例:Quidway(config-vpdn1)#local name itsme默认情况:系统默认的本端名称为路由器名(8) [no] l2tp tunnel authentication 启用/关闭L2TP通道验证功能举例:Quidway(config-vpdn1)#no l2tp tunnel authentication默认情况:系统默认对L2TP通道进行验证(9) l2tp tunnel password password 设置L2TP通道验证的密码为passwordno l2tp tunnel password 将L2TP通道验证的密码还原为默认值举例:Quidway(config-vpdn1)#l2tp tunnel password yougotit默认情况:系统默认的通道验证密码为路由器名(10) [no] force-local-chap 强制/禁止LNS与Client之间重新进行CHAP验证举例:Quidway(config-vpdn1)#force-local-chap默认情况:系统默认不进行CHAP的重新验证(11)accept-dialin l2tp virtual-template virtual-template-number remoteremote-peer-name 接受名称为remote-peer-name的对端发起的L2TP通道连接请求,并根据vitual-template virtual-template-number 创建virtual-access接口no accept dialin 删除此设置举例: Quidway(config-vpdn1)#accept-dialin l2tp virtual-template 1 remote A8010, 默认情况:系统默认为禁止接受呼入二 IPSec的配置Crypto isakmp policy1 /配置IKE策略1Authentication pre-share /IKE策略1的验证方法设为pre-shareGroup 2;1024-bit Diffie-Hellman /加密算法未设置则取默认值:DESCrypto isakmp key test123 address 202.96.1.2 /设置Pre-share密钥为test123,此值两端需一致crypto ipsec transform-set VPNtag ah-md5-hmac esp-des/设置AH散列算法为md5,ESP加密算法为DES.crypto map VPNdemo 10 ipsec-isakmp /定义crypto mapset peer 202.96.1.2 /设置隧道对端IP地址set transform-set VPNtag /设置隧道AH及ESPmatch address 101interface Tunnel0 /定义隧道接口ipaddress 192.168.1.1 255.255.255.0 /隧道端口IP地址no ip directed-broadcasttunnel source 202.96.1.1 /隧道源端地址tunnel destination 202.96.1.2 /隧道目的端地址crypto map VPNdemo /应用VPNdemo于此接口其他的略NAT——网络地址转换(1)静态地址转换ip nat inside source static 内部地址合法地址 (全局配置模式)举例: ip nat inside source static 10.1.1.2 192.1.1.2在内部地址X和合法地址Y之间建立静态转换ip nat inside /说明该端口是内网接口ip nat outside /说明该端口是外网接口(2)动态地址转换ip nat pool 地址池名称起始IP地址终止IP地址 netmask 子网掩码 (全局配置模式)举例:ip nat pool poolA 192.1.1.2 192.1.1.10 netmask 255.255.255.0/设置合法地址池,名为PoolA, 地址范围为192.1.1.2~192.1.1.10,子网掩码为255.255.255.0 access-list 标号 permit 源地址通配符(其中标号为1~99间的整数)举例:access-list 1 permit 10.1.1.0 0.0.0.255定义标准访问列表1,指出10.1.1.0/24的本地地址进行NAT转换ip nat inside source list 访问列表标号 pool 地址池名称举例:ip nat inside source list 1 pool poolA设置:对访问列表1中设置的本地地址,应用PoolA池进行动态地址转换(3)复用动态地址转换ip nat inside source list 访问列表标号 pool 地址池名称 overload举例:ip nat inside source list 1 pool poolA overload设置:对访问列表1中设置的本地地址,应用PoolA池进行复用动态地址转换。

相关文档
最新文档