Cisco Route多出口冗余
本文最后更新于 693 天前,其中的信息可能已经有所发展或是发生改变。
!
!
#其实这个实验根本不需要用到track和IP SLA,只需2条metric不同的静态路由即可。这里我写出来只是想了解下track的用法。
track 2 interface FastEthernet0/0 line-protocol  #这是一种track的写法,能直接检测接口的链路通断状态,我觉得要比结合IP SLA的更简单,但是不如IP SLA控制的精细。
 delay down 5 up 5
!
track 3 rtr 3 reachability  #结合下方的IP SLA 3实现检测下一跳是否可达。
 delay down 5 up 5
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 23.0.0.2 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex half
!
interface FastEthernet1/0
 ip address 24.0.0.2 255.255.255.0
 ip nat outside
 ip virtual-reassembly
 duplex auto
 speed auto
!
interface FastEthernet1/1
 ip address 12.0.0.1 255.255.255.0
 ip nat inside
 ip virtual-reassembly
 duplex auto
 speed auto
!
ip route 0.0.0.0 0.0.0.0 24.0.0.1 3  #实现线路故障后,自动切换。只需2条metric不同的静态路由就能实现。很简单!难点是route-map结合NAT部分。
ip route 0.0.0.0 0.0.0.0 23.0.0.1 2  #默认走这条线路
#其实,这里不给这2条静态路由指定metric也可以,只不过那样就不好控制流量的走向了。流量默认有可能走电信,也有可能走联通。
ip route 192.168.0.0 255.255.0.0 FastEthernet1/1
no ip http server
no ip http secure-server
!
!
#知识点1:多条nat语句时,从上到下顺序执行,匹配成功后,后面的不在执行。
ip nat inside source route-map PBR-DX interface FastEthernet0/0 overload   
ip nat inside source route-map PBR-LT interface FastEthernet1/0 overload
 #难点配置!!!我想了好半天才明白,如何实现线路切换时,NAT还能正常解析。
#因为如果是动态切换,所以每个出接口都得配置nat,而直接用access-list匹配流量是无法做到的,因为用ACL匹配流量,只能写一条ip nat inside source...语句,也就是说只能在一个出接口执行NAT。
!
ip sla 3
 icmp-echo 24.0.0.1 source-interface FastEthernet1/0
 frequency 5
ip sla schedule 3 life forever start-time now
logging alarm informational
access-list 90 permit any  #因为大部分公司,所有流量都是需要做nat的,因此这里直接匹配所有。
no cdp log mismatch duplex
!
!
route-map PBR-DX permit 10    #难点配置2!!!
 match ip address 90
 match interface FastEthernet0/0  
!
route-map PBR-LT permit 10
 match ip address 90
 match interface FastEthernet1/0  
#第一条match语句和上面的一样,最主要的就是第二条语句。
#我看网上很多人这里写的是set interface f1/0,我觉得那样写是不对的。
#因为这里的route-map的工作仅仅是匹配流量即可,无需做出什么动作。所以不应该出现set语句。
#至于match interface f1/0的含义,可以参考IOS说明:
# interface -- Match first hop interface of route
#我的理解是:根据路由的下一跳来匹配流量,因为这里要实现双ISP互备,所以默认静态路由会变,
#路由把流量导向哪个接口,我就用那个接口的IP地址做NAT。(比较拗口,结合图多想想就理解了。)
!
!
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇