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

[经验分享] Cisco ODR配置示例

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-5-6 08:29:49 | 显示全部楼层 |阅读模式
静态路由的缺点是,必须手工配置,同时在网络拓扑变化后需要手工更新;动态路由的缺点是,它们需要占用网络带宽和路由器资源。在包含数百个分支站点的中央-分支网络,采用静态路由时配置工作量将非常大,而采用动态路由时将占用大量的资源。
在这种情况下,我们采用第三种方式——按需路由(ODR,On Demand Routing)。ODR是Cisco的私有协议,它使用CDP在分支路由器和中央路由器之间传输网络信息。它的优点是,比动态路由协议开销小得多,比静态路由协议配置量少得多。而它的缺点就是,只适合于中央-分支拓扑。
在中央路由器的全局模式下使用router odr命令来启用ODR。
下面是ODR配置示例:
wKioL1VItLWS4fayAACVpFqtgYs051.jpg

R1配置如下:
R1#sh run     
Building configuration...

Current configuration : 1289 bytes
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption

hostname R1

boot-start-marker
boot-end-marker

enable secret 5 $1$xGcB$Oir1JjPzZdoLL4wxA7kPH1

aaa new-model


aaa authentication login default local

aaa session-id common
no ip icmp rate-limit unreachable

ip cef
no ip domain lookup

username cisco password 7 091D1C5A4D5041

ip tcp synwait-time 5

interface FastEthernet0/0
ip address 192.168.1.1 255.255.255.252
duplex auto
speed auto

interface FastEthernet0/1
ip address 192.168.1.5 255.255.255.252
duplex auto
speed auto

interface Serial1/0
no ip address
shutdown
serial restart-delay 0

interface Serial1/1
no ip address
shutdown
serial restart-delay 0

interface Serial1/2
no ip address
shutdown
serial restart-delay 0

interface Serial1/3
no ip address
shutdown
serial restart-delay 0

router odr                //配置ODR

no ip http server
no ip http secure-server

no cdp log mismatch duplex

control-plane

gatekeeper
shutdown

line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
no exec
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4

end


R2的配置如下:
R2#sh run
Building configuration...

Current configuration : 1319 bytes

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption

hostname R2

boot-start-marker
boot-end-marker

enable secret 5 $1$AOeH$KIuGrBL.TNS1Iwe0Kt8Bd0

aaa new-model

aaa authentication login default local

aaa session-id common
no ip icmp rate-limit unreachable

ip cef
no ip domain lookup

username cisco password 7 00554155500E5D

ip tcp synwait-time 5

interface Loopback0
ip address 2.2.2.2 255.255.255.255

interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.252
duplex auto
speed auto

interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto

interface Serial1/0
no ip address
shutdown
serial restart-delay 0

interface Serial1/1
no ip address
shutdown
serial restart-delay 0

interface Serial1/2
no ip address
shutdown
serial restart-delay 0

interface Serial1/3
no ip address
shutdown
serial restart-delay 0

no ip http server
no ip http secure-server

no cdp log mismatch duplex

control-plane

gatekeeper
shutdown

line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
no exec
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4

end


R3的配置如下:
R3#sh run
Building configuration...

*May  5 19:44:13.907:%SYS-5-CONFIG_I: Configured from console by console
Current configuration : 1319 bytes

version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
service password-encryption

hostname R3

boot-start-marker
boot-end-marker

enable secret 5 $1$nkGN$k3DeFEbRxkr8ILTnGTpDu/

aaa new-model


aaa authentication login default local

aaa session-id common
no ip icmp rate-limit unreachable


ip cef
no ip domain lookup

username cisco password 7 075E731F1A5C4F

ip tcp synwait-time 5

interface Loopback0
ip address 3.3.3.3 255.255.255.255

interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto

interface FastEthernet0/1
ip address 192.168.1.6 255.255.255.252
duplex auto
speed auto

interface Serial1/0
no ip address
shutdown
serial restart-delay 0

interface Serial1/1
no ip address
shutdown
serial restart-delay 0

interface Serial1/2
no ip address
shutdown
serial restart-delay 0

interface Serial1/3
no ip address
shutdown
serial restart-delay 0

no ip http server
no ip http secure-server

no cdp log mismatch duplex

control-plane

gatekeeper
shutdown

line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
no exec
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4

end


用R2去ping R3,测试连通性:
R2#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/62/64ms


查看R1的路由表:
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRPexternal, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA externaltype 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type1, E2 - OSPF external type 2
       i - IS-IS, su - IS-ISsummary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area,* - candidate default, U - per-user static route
       o - ODR, P - periodicdownloaded static route

Gateway of last resort is not set

     2.0.0.0/32 is subnetted,1 subnets
o       2.2.2.2 [160/1] via192.168.1.2, 00:00:22, FastEthernet0/0
     3.0.0.0/32 is subnetted,1 subnets
o       3.3.3.3 [160/1] via192.168.1.6, 00:00:27, FastEthernet0/1
     192.168.1.0/30 issubnetted, 2 subnets
C       192.168.1.0 isdirectly connected, FastEthernet0/0
C       192.168.1.4 isdirectly connected, FastEthernet0/1


查看R2的路由表:
R2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRPexternal, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA externaltype 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPFexternal type 2
       i - IS-IS, su - IS-ISsummary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area,* - candidate default, U - per-user static route
       o - ODR, P - periodicdownloaded static route

Gateway of last resort is 192.168.1.1 to network 0.0.0.0

     2.0.0.0/32 is subnetted,1 subnets
C       2.2.2.2 is directlyconnected, Loopback0
     192.168.1.0/30 issubnetted, 1 subnets
C       192.168.1.0 isdirectly connected, FastEthernet0/0
o*   0.0.0.0/0 [160/1] via 192.168.1.1, 00:00:16, FastEthernet0/0

查看R3的路由表:
R3#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRPexternal, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA externaltype 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type1, E2 - OSPF external type 2
       i - IS-IS, su - IS-ISsummary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area,* - candidate default, U - per-user static route
       o - ODR, P - periodicdownloaded static route

Gateway of last resort is 192.168.1.5 to network 0.0.0.0

     3.0.0.0/32 is subnetted,1 subnets
C       3.3.3.3 is directlyconnected, Loopback0
     192.168.1.0/30 issubnetted, 1 subnets
C       192.168.1.4 isdirectly connected, FastEthernet0/1
o*   0.0.0.0/0 [160/1] via 192.168.1.5, 00:00:45, FastEthernet0/1



运维网声明 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-63981-1-1.html 上篇帖子: 单臂路由和dhcp 下篇帖子: Nat--网络地址转换—静态篇 Cisco
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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