这是在近期网络技术培训中,熟悉了网络设备的配置,现将整理的常用配置命令及简要说明陈列于此。

路由器
路由器引导方式配置
Router(config)#boot system flash [IOS文件名] //从flash中引导
Router(config)#boot system fttp [tftp地址] [IOS文件名] //从TFTP中引导
Router(config)#boot syste rom //从rom中引导
说明:若有多条加载路径,启动时按顺序加载,若第一条加载失败则试图从随后路径中加载。
用户名与口令
router(config)#username tang password bang
本地登录认证
router(config)#line vty 0 4
router(config)# login //使用enable密码进行登录验证,也可以通过password语句设置密码。
router(config-line)#login local  //使用已建立的用户名和密码进行验证
接口配置
router(config)#interface s0
router(config-if)#ip address 192.168.1.1 255.255.255.0
timeout时间设置
router(config)#line console 0
router(config-line)#exec-timeout [min] [sec] //无动作时超时
router(config-line)#session-timeout [min] //会话超时
router(config-line)#absolute-time //绝对超时
权限设置
router(config)#privilege exec level [0-15] [命令] //[命令]为当前权限下允许执行的命令,如:show run
静态路由
router(config)#ip route [目的网络] [掩码] [下一跳地址|出口] [管理距离] [不通是否删除]
router(config)#ip route [目的网络] [掩码] [null 0|loopback 0] //目的网络对应的IP包被丢弃。
说明:可以设置null接口参数,使路由器向客户端返回或不返回“目标不可达”的ICMP包。默认情况下要返回ICMP。如:
Router(config)#int null 0
Router(config-if)#ip unreachables //向客户端返回目标不可达信息
Router(config-if)#no ip unreachables //不返回目标不可达信息,客户端显示超时。
route-map设置
router(config)#route-map Engineers [permit|deny] [序号] //定义标记为Engineers的route-map。
router(config-route-map)#match ip address [访问列表号] //设置访问列表定义的匹配条件
router(config-route-map)#set ip next-hop 10.15.27.1 //匹配后设置下一跳地址
router(config-if)#ip policy route-map Engineers //在接口上应用Engineers.
OSPF路由
OSPF路由基本配置
router(config)#router ospf 10
router(config-router)#network 192.168.2.0 0.0.0.255 area 0
OSPF认证
区域明文认证模式命令:
Router(config-router)# area area-id authentication
Router(config-if)# ip ospf authentication-key key
区域MD5认证模式命令:
Router(config-router)# area area-id authentication message-digest
Router(config-if)# ip ospf message-digest-key key-id md5 md5key
接口明文认证模式命令:
Router(config-if)# ip ospf authentication
Router(config-if)# ip ospf authentication-key key
接口MD5认证模式命令:
Router(config-if)# ip ospf authentication message-digest
Router(config-if)# ip ospf message-digest-key key-id md5 md5key
虚链路上的认证
Router(config-router)#area [区域号] virtual-link [对端路由器ID] authentication [authentication-key 密码|message-disgest |null ]
如:router(config-router)#area 1 vir 2.2.2.2 authe me //在虚链路上启用MD5认证
Router(config-router)#area 1 vir 2.2.2.2 me 1 md5 cisco //认证认证参数
OSPF Stub区域
stub区域内部路由器: area area-id stub  
stub区域ABR: area area-id stub  
totally stubby区域内部路由器: area area-id stub  
totally stubby区域ABR: area area-id stub no-summary
说明:stub区域配置需要在区域内所有路由器上配置,边界路由器会将静态路由和内部网关路由信息传递到区域内,而不将自治系统外部路由传入。完全stub区域配置只需在边界路由器上配置,区域内其它路由器只配置成stub区域。边界路由器只将静态路由传入区域内部路由器,而不传递内部和外部路由信息到区域内。
OSPF cost值修改
router(config)#int s1/0
router(config-if)#ip ospf cost 10 直接修改ospf cost的值
router(config-router)#auto-cost reference-bandwidth 1000 //修改带宽参考值,单位Mb/s,默认参考带宽为100。
OSPF区域路由汇总和在接口上禁用OSPF
router(config-router)#area [区域号] rang 192.168.0.0 255.255.0.0(子网范围)
router(config-router)#passive-interface f0/1 //在接口f0/1上禁用ospf,尤其是有多个路由协议时,通过在接口上禁用某种路由协议,防止路由环路形成。
router(config-router)#passive-interface default //所有接口都被动接收,若要使某个接口发送ospf信息,可以使用下面的命令:
router(config-router)#no passive-interface f0/1 
路由重发布
Router(config-router)#default-information generate [always| metric|metric-type]  //在区域内产生默认路由并广播到区域内,此命令用于ASBR。Always用于防止缺省链路抖动,metric用于修改重发布路由的metric值。Metric-type是通告路由的类型。
Router(config-router)#redistribute rip [subnets] //重发布rip协议的路由,有subnets参数时支持变长子网,否则只支持有类路由。
Router(config-router)#redistribute static [subnets] //重发布静态路由
Router(config-router)#redistribute connected //重发布直接相连网络
说明:重发布路由时还应指定metric,rip协议中重发布OSPF时,默认metric为16,这样,rip协议的路由器就无法学习到ospf的路由,要解决这个问题,要么设置默认metric,要么在重发布路由时指定metric。如下:
Router(config)#router rip
Router(config-router)#redistribute ospf 10 metric 1 //metric范围为1-15
或:
Router(config-router)#default-metric 1  //指定学习到的路由信息默认metric为1
OSPF路由策略
router(config-router)#redistribute static route-map Engineers //在重发布路由时,根据router-map进行路由过滤。此例为重发布静态路由,route-map名为Engineers。
Router(config-router)#distribute-list [访问列表号|访问列表名] in|out //根据访问列表进行路由过滤
lookback设置
router(config)#interface lookback 0
router(config-if)#ip add 1.1.1.1 255.255.255.255 
访问列表
标准访问列表:
router(config)#access-list 20 [deny|permi] host 192.168.4.3 一个地址
router(config)#access-list 20 [deny|permi] 192.168.2.0 255.255.255.0 一个地址段
router(config)#int s1/4
router(config-if)#ip access-group 20 [in|out] 将访问列表加入到接口中
扩展访问列表:
router(config)#access-list 110 deny tcp any host 192.168.2.1 eq www
router(config)#acc 110 permit ip any any
router(config)#acc 120 permit ip any any time-range [时间范围名] //根据时间范围进行过滤。时间范围在全局配置模式下使用time-range [时间范围名] 命令进行定义。
说明:需要注意的是,访问列表默认是阻止所有!如果仅禁用WWW,则应该在后面添加一句permit ip any any。
telnet登录地址限制
router(config)#access-list 11 per 192.168.1.34
router(config-line)#lin vty 0 4
router(config-line)#access-class 11 in
说明:只允许IP地址为192.168.1.34的telnet登录到路由器
Router(config-line)#rotary 25 //添加一个登录端口3000+25
Chap和pap认证
chap 认证
router(config)#username r1 password pass
router(config-if)#encapsulation ppp
router(config-if)#ppp authentication chap
说明:使用chap验证的双方在配置用户名和密码时,密码必须一致。服务端要求验证的用户名是对端路由器名。
pap 认证
router(config)#username r2 password pass2
router(config)#interface s0
router(config-if)#encapsulation ppp
router(config-if)#ppp pap sent-username  r1 password pass1
说明:两端交叉配置,发送对方所设置的用户名和密码。
帧中继配置
router(config)#frame-relay switching //启用PVC交换
router(config)#int s1/0
router(config-if)#ip add 192.168.1.1 255.255.255.0
router(config-if)#encapsulation frame-relay
router(config-if)#fr intf-type dce//另一端默认定义DTE ,也可以两端都设成NNI ,设成nni时可动态生成frame-relay map ip ,但生成map的速度较慢。
router(config-if)#fr interface-dlci 100 //定义DLCI号,DTE需要使用DLCI号
router(config-if)#fr map ip 192.168.1.2 100 broadcast
router(config-if)#fr lmi-type ansi
router(config-if)#no sh
如果使用OSPF协议,帧中继默认的网络类型是NBMA。需要在定义ospf路由信息时使用neighbor 192.168.1.2 语句,否则OSPF生成的路由表中没有通过帧中继网的路由信息。也可以在接口模式下,将网络类型改变为广播、点对点、点对多点,这样就不必在定义OSPF路由neighbor。
router(config-if)#ip ospf network point-to-point //更改OSPF网络类型,可以改为broadcast, point-to-multicast, non-broadcast
router#show frame-relay map //此语句可显示DLCI与IP地的映射,如果两端显示的状态均为active,则可正常通信。
SNMP协议
router(config)#snmp-server community public ro
router(config)#snmp-server host 192.168.1.2 traps public
说明:public是一个范围的名称 host 192.168.1.2是一个snmp的服务器,可以通过该服务器对此路由器进行snmp的管理
组播协议(域内路由协议PIM的配置)
启用多播路由
router(config)# ip multicast-routing
路由器之间接口配置为稀疏模式:
Router(config-if)#ip pim sparse-mode
路由器与主机相连的接口配置成被动模式
Router(config-if)# ip pim passive //3640上没有此命令
候选RP、BSR配置
全局配置模式下配置候选BSR,候选RP ,这两个接口都应当连接到路由器
Router(config)# ip pim bsr-candidate Ethernet 1/3
Router(config)# ip pim rp-candidate Ethernet 1/1

CISCO3640路由器配置参考相关推荐

  1. 最详细的CISCO路由器配置命令及方法

    第一章 路由器配置基础 一.基本设置方式 二.命令状态 三.设置对话过程 四.常用命令 五.配置IP寻址 六.配置静态路由 第二章 广域网协议设置 一.HDLC 二.PPP 三.X.25 四.Fram ...

  2. 路由器配置与管理完全手册(Cisco篇)学习感想

    下面是转发自一位非常好,在电信工作的朋友对我的<路由器配置与管理完全手册--Cisco篇>一书所写的读后感,非常感谢!!他是位非常出色的电信工程师,而且非常所年轻(只能告诉大家,远没到30 ...

  3. CISCO路由器配置手册--第五章 虚拟局域网(VLAN)路由

    一.虚拟局域网(VLAN) 当前在我们构造企业网络时所采用的主干网络技术一般都是基于交换和虚拟网络的.交换技术将共享介质改为独占介质,大大提高网络速度.虚拟网络技术打破了地理环境的制约,在不改动网络物 ...

  4. 网络工程师学习参考资料路由器配置案例分析

    网络工程师学习参考资料路由器配置案例分析 2006-08-30 23:01:00 标签:配置 路由器 案例 网络工程师 [推送到技术圈] INTERNET共享资源的方式越来越多,就大多数而言,DDN专 ...

  5. Cisco PacketTracer5---三层交换机连接路由器配置

    基础配置参考: PacketTracer---静态路由: https://blog.csdn.net/qq_40163937/article/details/88957269 Cisco Packet ...

  6. 路由器配置(新手上路,比较全面,强烈推荐)

    路由器配置(新手上路,比较全面,强烈推荐) 第一章 路由器配置基础 一.基本设置方式 二.命令状态 三.设置对话过程 四.常用命令 五.配置IP寻址 六.配置静态路由 第二章 广域网协议设置 一.HD ...

  7. 三级网络技术备考重点之路由器配置及使用

    计算机三级网络技术:第七章路由器配置及使用 三级网络技术备考重点之路由器配置及使用 1.路由器概述 路由器是工作在网络层的设备. 路由器负责将数据分组从源端主机经最佳路径传送到目的端主机 路由器具有异 ...

  8. hiwifi(gee极路由)路由器配置:

    hiwifi(gee极路由)路由器配置: 这两天宿舍WiFi账号密码登录不上了,有时候手机连接上了也没有网,于是动手重新设置路由啦,希望能帮到大家,让我们 现在开始吧 ! 准备:电脑一台,额外网线一根 ...

  9. 实验室NEWIFI-D1路由小云系统简易配置参考

    上一篇博客使用的是华硕的固件,但是无奈硬盘在第三方固件下可能会出现未能识别的错误,折腾一天也无法解决.所以重新刷回了NEWIFI官方的老的路由系统,也是基本能实现功能. 预期实现功能 需要实现的三大功 ...

最新文章

  1. php中创建关联数组,以及遍历数组
  2. PHP开发环境MAMP for Windows
  3. VTK:图像平移范围用法实战
  4. Python+OpenCV人脸识别技术详解
  5. C++ I/O 流 格式控制(上)
  6. 2017.10.8 志愿者招募 失败总结
  7. matlab predict函数并行,Matalb 智能算法第29个案例运行报错问题
  8. Ubuntu学习(应用集合、命令行以及遇到的问题)
  9. 使用ps制作旧羊皮纸
  10. linux让指定文件具有sudo的权限,Linux学习笔记——使用指定的用户权限执行程序——sudo...
  11. 十五届恩智浦智能车杀青
  12. AVOD阅读笔记(二):多模型融合RPN----Aggregate View Obeject Detection network
  13. 友情链接SEO工具检测不出来
  14. 通过添加dns加速访问app store
  15. cs231n-LSTM_Captions
  16. Apache中 RewriteRule 规则参数介绍
  17. flex: 0 0 auto
  18. 免费资源 | Photoshop资料合集免费领取!快速get PS技能!
  19. Ackermann函数(阿克曼函数)的递归、非递归(手动栈模拟)
  20. Qumulo体系结构白皮书

热门文章

  1. mac kafka安装
  2. python在哪个城市工资高_“英语学科教学和笔译专业,哪个工资较高?”
  3. Linux常见查看命令
  4. 【大数据】计算引擎之三:Hadoop处理框架
  5. CTK编译及使用(Qt5.9.9 + MSVC2015_x64 + CMake3.23.1)
  6. composer 安装阿里云sdk
  7. 通讯录【三】文件版本
  8. visual studio提示使用_CRT_SECURE_NO_WARNINGS
  9. 【一】Java语言基础思维导图
  10. 安装Bioperl最基本模块Bio::SeqIO