设为首页 收藏本站
查看: 657|回复: 0

[经验分享] 【资料整理】cisco [cli, static, rip, eigrp, ospf]

[复制链接]

尚未签到

发表于 2018-7-20 06:08:02 | 显示全部楼层 |阅读模式
3. CLI  
{
  
1)设定密码、接口IP地址
  
router>
  

  
router>enable
  
router#
  
router#configure terminal
  
router(config)#hostname A
  
A(config)#enable secret APwd
  
A(config)#interface fastEthernet 0/1
  
A(config-if)#ip address 10.1.1.1 255.255.255.0
  
A(config-if)#description Your Desc
  
A(config-if)#no shutdown
  
A(config-if)#line console 0
  
A(config-line)#password ConsolePwd
  
A(config-line)#login
  
A(config-line)#logging synchronous
  
A(config-line)#exec-timeout 0 0
  
A(config-line)#line aux 0
  
A(config-line)#password AuxPwd
  
A(config-line)#login
  
A(config-line)#exit
  
A(config)#line vty 0 ?
  
<1-4> Last line number
  
<cr>
  
A(config)#line vty 0 4
  
A(config-line)#password TelnetPwd
  
A(config-line)#login
  
A(config-line)#exit
  
A(config)#no ip domain-lookup
  
A(config)#banner motd # This is my router #
  
A(config)#end
  
A#copy run start
  
A#
  

  

  

  
2)验证命令
  
sh run | begin interface
  

  
sh ip route
  
sh ip protocols
  
debug ip rip
  
sh ip route eigrp
  
sh ip eigrp neighbors
  
sh ip eigrp topology
  
debug eigrp packet
  
debug ip eigrp notification
  
sh ip ospf database
  
sh ip ospf interface
  
sh ip ospf neighbor
  
debug ip ospf packet
  
debug ip ospf hello
  
debug ip ospf adjacency
  

  

  

  
3)静态路由
  
R1(config)#ip route 172.16.3.0 255.255.255.0 192.168.2.4
  

  
R1(config)#ip route 172.16.3.0 255.255.255.0 192.168.2.4 150  //管理距离AD=150
  
R1(config)#ip route 172.16.3.0 255.255.255.0 s0/0  //用借口代替Next hop 地址
  
R1(config)#ip route 0.0.0.0 0.0.0.0 10.1.11.1 //静态路由
  
R1(config)#ip route 0.0.0.0 0.0.0.0 vlan1
  
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0
  
R1(config)#ip default-network 10.1.11.1
  

  

  
4)动态路由
  
AD(Administrative Distance)
  

  
-----------------
  
interface  0
  
Static  1
  
EIGRP  90
  
IGRP  100
  
OSPF  110
  
RIP   120
  
EEIGRP  170
  
UNKNOWN 255
  

  

  
5) RIP
  
A#conf t
  

  
A(config)#router rip
  
A(config-router)#network 10.0.0.0
  

  
A(config-router)#version 2 //使用RIPv2
  
A(config-router)#passive-interface s0/0    //阻止RIP更新广播从该接口发出。
  

  

  
6)EIGRP
  
A#conf t
  

  
A(config)#router eigrp 10
  
A(config-router)#network 10.0.0.0
  

  
A(config-router)#maximum-paths ?   //默认支持4条链路的不等代价的负载均衡
  
<1-6> Number of paths
  
A(config-router)#maximum-hops ?    //默认最大跳计数值是100,通常不用修改
  
<1-255> hop count
  

  
//再发布
  
A(config)#router eigrp 10
  
A(config-router)#redistribute rip metric 10000000 20000 255 1 1500
  

  
B(config)#router rip
  
B(config-router)#redistribute eigrp 10 metric 1
  

  
//不连续网络
  
A(config)#router eigrp 100
  
A(config-router)#network 172.16.0.0
  
A(config-router)#network 10.0.0.0
  
A(config-router)#no auto-summary
  

  
B(config)#router eigrp 100
  
B(config-router)#network 172.16.0.0
  
B(config-router)#network 10.0.0.0
  
B(config-router)#no auto-summary
  

  

  
7)OSPF
  
A(config)#router ospf 1
  

  
A(config-router)#network 10.0.0.0 0.255.255.255 area 0    // = 10.0.0.0/8
  
A(config-router)#network 192.168.10.64 0.0.0.15 area 0    // = 192.168.10.64/28
  
A(config-router)#network 192.168.10.80 0.0.0.15 area 0    // = 192.168.10.80/28
  
A(config-router)#network 192.168.10.96 0.0.0.15 area 0    // = 192.168.10.96/28
  
A(config-router)#network 192.168.10.8 0.0.0.3 area 0        // = 192.168.10.8/30
  

  

  

  
#OSPF RID Loopback
  
A#sh ip ospf
  

  
Routing Process "ospf 10" with ID 10.1.1.1
  
[output cut]
  
A(config)#int loopback 0
  
A(config-if)#ip address 172.16.8.1 255.255.255.255
  
[reboot]
  
A#sh ip ospf
  
Routing Process "ospf 10" with ID 172.16.8.1
  
[output cut]
  

  
A(config)#router ospf 10
  
A#(config-router)router-id 172.16.8.1
  
A#(config-router)do clear ip ospf process
  
A#(config-router)do sh ospf 10
  
Routing Process "ospf 10" with ID 172.16.8.1
  
[output cut]
  

  

  

  
#OSPF priority
  
A(config)#int f0/0
  

  
A(config-if)#ip ospf prority 2
  

  

  
#配置EIGRP和OSPF汇总路由
  
EIGRP:
  
Core(config)#router eigrp 10
  

  
Core(config-router)#network 192.168.10.0
  
Core(config-router)#network 10.0.0.0
  
Core(config-router)#no auto-summary
  
Core(config-router)#interface ethernet 0
  
Core(config-if)#ip summary-address eigrp 10 192.168.10.64 255.255.255.224
  

  

  
OSPF:
  
Core(config)#router ospf 1
  

  
Core(config-router)#network 192.168.10.64 0.0.0.3 area 1
  
Core(config-router)#network 192.168.10.68 0.0.0.3 area 1
  
Core(config-router)#network 10.10.10.0 0.0.0.255 area 0
  
Core(config-router)#area 1 range 192.168.10.64 255.255.255. 224
  

  

  
}

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-538857-1-1.html 上篇帖子: CISCO路由交换型号字母含义 下篇帖子: cisco 交换机加入 cacit需要开启的参数
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表