Cloud Native应用交付

  • 首页
  • 关于本站
  • 个人介绍
  • Downloads
  • Repo
    • Github
    • Container
  • F5
    • F5 Python SDK
    • F5-container
    • F5-LBaaS
  • 社交
    • 联系我
    • 微信/微博
    • 公众号
    • 打赏赞助
行至水穷处 坐看云起时
Cloud Native Application Services: cnadn.net
  1. 首页
  2. 项目案例
  3. 正文

[原创]巧用PBR实现不同网段走不同ISP,且互备实验(一个不算完美的解决方法)

2006年11月4日 14850点热度 0人点赞 1条评论

上次试验没有完全成功,因为默认路由的问题导致ROUTE-MAP匹配有时会错乱。详细描述见:http://www.mycisco.cn/post/150.html

这次试验利用了PBR,来控制精确的选择出口.思路:
利用PBR优先使用第一个可用接口,给每个PBR故意设置不同顺序

配置:
hostname r4
!
!
ip subnet-zero
!
!
!
!
!
!
interface Ethernet0/0
 ip address 192.168.1.4 255.255.255.0
 ip nat inside
 ip policy route-map isp1-nextif
 half-duplex
!
interface Ethernet0/1
 ip address 192.168.2.4 255.255.255.0
 ip nat inside
 ip policy route-map isp2-nextif
 half-duplex!
interface Ethernet0/2
 no ip address
 shutdown
 half-duplex
!
interface Ethernet0/3
 no ip address
 shutdown
 half-duplex
!
interface Serial1/0
 ip address 10.0.0.1 255.255.255.0
 no shu
 ip nat outside
 serial restart-delay 0
!
interface Serial1/1
 ip address 20.0.0.1 255.255.255.0
 no shu
 ip nat outside
 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
!
ip nat pool isp1 10.0.0.1 10.0.0.1 prefix-length 24
ip nat pool isp2 20.0.0.1 20.0.0.1 prefix-length 24
ip nat inside source route-map toisp1 pool isp1 overload
ip nat inside source route-map toisp1-2 pool isp2 overload
ip nat inside source route-map toisp2 pool isp2 overload
ip nat inside source route-map toisp2-1 pool isp1 overload

!这里需要注意,试验证明采用POOL时候,工作起来不是很正常
当我关闭ISP1所连的S1/0接口后
这个时候1网段的应该走ISP2接口,调试表明确实走了ISP2那个口
但是
这个时候NAT表里只容许1网段的转成ISP2的地址
2网段的数据包 报NAT失败 包被丢弃
NAT配置中将POOL改成使用接口,则无此问题
所以这里不要使用地址池,只能使用接口做NAT。 


ip classless
ip route 0.0.0.0 0.0.0.0 10.0.0.3
ip route 0.0.0.0 0.0.0.0 20.0.0.5
!这个默认路由已经可以省略了,PBR优先于它。

ip http server
!
access-list 100 permit ip 192.168.1.0 0.0.0.255 any
access-list 101 permit ip 192.168.2.0 0.0.0.255 any
route-map toisp1 permit 10
 match ip address 100
 match interface Serial1/0
!
route-map toisp2 permit 10
 match ip address 101
 match interface Serial1/1
!
route-map toisp1-2 permit 10
 match ip address 100
 match interface Serial1/1
!
route-map toisp2-1 permit 10
 match ip address 101
 match interface Serial1/0
!
route-map isp2-nextif permit 10
 match ip address 101
 set interface s1/0 s1/1

!
route-map isp1-nextif permit 10
 match ip address 100
 set interface s1/1 s1/0
!利用PBR优先使用第一个可用接口的特性

!
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
!
end

测试中没发现其他什么问题,如有问题请留言,感谢。

相关文章

  • [原创]巧用route-map顺序实现不同网段走不同ISP,且互备实验,问题源自91lab论坛网友提问
  • 暴风影音DNS事件分析
  • 配置组播(最少配置)
  • [转]RTR/SLA 在多ISP环境下下的应用--已经更新,切换后线路恢复时,已能自动恢复
  • 【原创】用CISCO VPN-Client4.01连接扩展验证-VPN-SERVER配置
本作品采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可
标签: NAT route-map
最后更新:2006年11月4日

纳米

linjing.io

打赏 点赞
< 上一篇
下一篇 >

文章评论

  • 纳米

    这个时候可能还有没考虑到
    建议大家这样测试,PING的目标地址在一个路由器后,即模拟一个IP位于ISP之后,看看set interface是不是会出现ARP问题!

    2006年11月9日
    回复
  • razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
    取消回复

    这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

    页面AI聊天助手

    纳米

    linjing.io

    ☁️迈向Cloud Native ADC ☁️

    认证获得:
    TOGAF: ID 152743
    Kubernetes: CKA #664
    Microsoft: MCSE MCDBA
    Cisco: CCNP
    Juniper: JNCIS
    F5:
    F5 Certified Solution Expert, Security
    F5 Certified Technology Specialist, LTM/GTM/APM/ASM
    F5 Certified BIG-IP Administrator
  • 点击查看本博技术要素列表
  • 归档
    分类
    • AI
    • Automation
    • Avi Networks
    • Cisco ACI
    • CISCO资源
    • F5 with ELK
    • F5-Tech tips
    • F5技术
    • Juniper
    • Linux
    • NGINX
    • SDN
    • ServiceMesh
    • WEB编程
    • WINDOWS相关
    • 业界文章
    • 交换机技术
    • 化云为雨/Openstack
    • 协议原理
    • 容器/k8s
    • 我的工作
    • 我的生活
    • 网站技术
    • 路由器技术
    • 项目案例
    标签聚合
    gtm DNS neutron istio docker k8s network irule nginx openstack flannel F5 envoy bigip api
    最近评论
    汤姆 发布于 8 个月前(09月10日) 嗨,楼主,里面的json怎么下载啊,怎么收费啊?
    汤姆 发布于 8 个月前(09月09日) 大佬,kib的页面可以分享下吗?谢谢
    zhangsha 发布于 1 年前(05月12日) 资料发给我下,谢谢纳米同志!!!!lyx895@qq.com
    李成才 发布于 1 年前(01月02日) 麻烦了,谢谢大佬
    纳米 发布于 1 年前(01月02日) 你好。是的,因为以前下载系统插件在一次升级后将所有的下载生成信息全弄丢了。所以不少文件无法下载。DN...
    浏览次数
    • Downloads - 183,772 views
    • 联系我 - 118,966 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 116,511 views
    • Github - 103,661 views
    • F5常见log日志解释 - 79,774 views
    • 从传统ADC迈向CLOUD NATIVE ADC - 下载 - 74,625 views
    • Sniffer Pro 4 70 530抓包软件 中文版+视频教程 - 74,320 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 67,770 views
    • 关于本站 - 60,911 views
    • 这篇文档您是否感兴趣 - 55,495 views
    链接表
    • F5SE创新
    • Jimmy Song‘s Blog
    • SDNlab
    • Service Mesh社区
    • 三斗室
    • 个人profile
    • 云原生社区

    COPYRIGHT © 2023 Cloud Native 应用交付. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    京ICP备14048088号-1

    京公网安备 11010502041506号