路由器常用配置命令

上传人:wt****50 文档编号:34007227 上传时间:2018-02-19 格式:DOC 页数:6 大小:56.50KB
返回 下载 相关 举报
路由器常用配置命令_第1页
第1页 / 共6页
路由器常用配置命令_第2页
第2页 / 共6页
路由器常用配置命令_第3页
第3页 / 共6页
路由器常用配置命令_第4页
第4页 / 共6页
路由器常用配置命令_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《路由器常用配置命令》由会员分享,可在线阅读,更多相关《路由器常用配置命令(6页珍藏版)》请在金锄头文库上搜索。

1、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/2

2、3 / 进入端口 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-addre

3、ss-table aging-time 100 / 设置超时是时间为 100smac-address-table permanent 0000.0c01.cc /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 子配置模式

4、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 #vla

5、n 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(con

6、fig-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-p

7、riority 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

8、 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 接口

9、阻止在指定的接口发送路由更新协议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-ho

10、p 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 不自动根据每个接口

11、的带宽,计算出其 costip 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 /设置

12、封装协议为 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 信息undebu

13、g 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/设置用户名和口

14、令,即设置拨号链路对端路由器名为 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 3

15、02 之间建立关联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 se

16、ssion(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-vpd

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号