Yuri Slobodyanyuk Blog on Information Security 2024年09月12日
Playing with RIP on ASA
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文介绍了在 Cisco ASA 上配置 RIP 协议的各种场景,包括配置、调试和验证。文章涵盖了 RIP 版本选择、网络配置、接口配置、汇总配置、认证配置、重分布配置以及调试和验证等方面。

😊 **启用 RIP 协议:** 在 Cisco ASA 上启用 RIP 协议,并指定要使用的版本(RIPv1 或 RIPv2),以及要激活 RIP 协议的网络。 例如,要启用 RIPv2 并指定网络 5.0.0.0,可以使用以下命令: ASA(config)# router rip TokyoASA(config-router)# version 2 TokyoASA(config-router)# network 5.0.0.0

😊 **配置接口:** 可以配置接口来控制 RIP 更新的广播方式。例如,可以使用 `passive-interface` 命令将接口设置为被动模式,以阻止接口广播 RIP 更新。 例如,要将所有接口设置为被动模式,可以使用以下命令: TokyoASA(config-router)# passive-interface default 要将特定接口设置为被动模式,可以使用以下命令: TokyoASA(config-router)# passive-interface outside

😊 **配置认证:** 可以配置 RIP 认证以确保 RIP 更新的安全性。认证可以在接口级别配置,并指定使用 MD5 或文本模式进行认证。 例如,要配置接口 `Ethernet0/0` 使用 MD5 模式进行认证,并指定认证密钥 `MYKEY` 和密钥 ID `33`,可以使用以下命令: TokyoASA(config-if)# ripauthentication modemd5 TokyoASA(config-if)# ripauthentication key MYKEY key_id 33

😊 **重分布:** 可以将从其他路由协议(例如 OSPF)学习到的路由重分布到 RIP 中。重分布可以通过路由映射来实现,以对重分布路由进行过滤和匹配。 例如,要将连接路由重分布到 RIP 中,并使用路由映射 `RIPv2` 对重分布路由进行过滤,可以使用以下命令: TokyoASA(config-route-map)# match ip address FILTER-ACL TokyoASA(config-route-map)# route-map RIPv2 permit 10 match ip address FILTER-ACL match interface inside TokyoASA(config-router)# redistribute connected route-map RIPv2 metric 13

Cisco ASA and RIP
RIP has been with ASA for years and in this article I will try to cover all possible scenarios in configuring, misconfiguring. debugging and verifying it. As I come up with new ideas how to break the RIP on ASA I will update this article as well.As it would be expected ASA has a bit limited version of RIP daemon as compared with IOS one. Major tasks you my be required to do :

SO let’s get our hands dirty.

Enable RIP routing process.

ASA#conf tASA(config)# router rip   TokyoASA(config-router)#

Set it to run exclusively version 2 . ASA doesn’t know to mix version2 and 1 as IOS does.

TokyoASA(config-router)# version 2

Networks to be active for . You should specify classful nets or even if you specify anything different after you enter such networks ASA will automatically turn them into classful ones anyway.

TokyoASA(config-router)#  network 5.0.0.0

Verifying configuration so far:

TokyoASA(config-router)# sh run routerrouter rip network 5.0.0.0    version 2

You will most probably want to disable summarization :

TokyoASA(config-router)# no auto-summary 

Exclude some interface from advertising on it:
- To suppress on ALL interfaces in one go:

TokyoASA(config-router)# passive-interface  default 
TokyoASA(config-router)# passive-interface  outside 

Authentication is configured exclusively under the interface :- Dictate which authentication mode to use.

TokyoASA(config-if)# rip authentication mode md5 
TokyoASA(config-if)# rip authentication key MYKEY key_id 33  

Here is how it looks in show run interface :

interface Ethernet0/0    nameif outside    security-level 0    ip address 136.6.12.12 255.255.255.0    rip authentication mode md5    rip authentication key <removed> key_id 33 

Redistribute. Just redistributing learned in other ways networks into the RIP would be boring. As usual you redistribute connected, static, ospf and rip (when working with the rest of the protocols).

TokyoASA(config-router)# redistribute ? router mode commands/options:     connected  Connected     ospf       Open Shortest Path First (OSPF)     rip        Routing Information Protocol (RIP)     static     Static routes

Much more interesting is to implement some policy while redistributing using route-maps. As expected route-maps here are not what we used to know in IOS.So what can you match for me ?

TokyoASA(config-route-map)# match ? route-map mode commands/options:  interface   Match first hop interface of route      ip              Match IP address or next-hop or route-source     metric       Match metric of route     route-type  Match route-type of route 

The most familiar and useful match on ACL lies here:

TokyoASA(config-route-map)# match ip ? route-map mode commands/options:      address       Match address of route or match packet     next-hop      Match next-hop address of route     route-source  Match advertising source address of route 
TokyoASA(config-route-map)# match ip address FILTER-ACL   TokyoASA(config-route-map)#  route-map RIPv2 permit 10    match ip address FILTER-ACL    match interface inside   TokyoASA(config-router)# redistribute connected  route-map RIPv2 metric 13 

About rest of the match conditions, I’ll cover them when talking about OSPF in ASA.

TokyoASA(config-route-map)# match route-type ? route-map mode commands/options:     external       Match external route (OSPF type 1/2)     internal       Match internal route (including OSPF intra/inter area)     local          Match locally generated route     nssa-external  Match nssa-external route (OSPF type 1/2) 

Filtering out routes in updates.
If you want to filter some networks in updates use distribute-list.

TokyoASA(config-router)# distribute-list MYACL ? router mode commands/options:     in   Filter incoming routing updates     out  Filter outgoing routing updates 

Now some debug is due.
Enable rip debug:

TokyoASA1# debug ripTokyoASA1# sh debugdebug rip routing   debug rip database   debug rip events 

Normal functioning protocol debug output:

add 10.0.2.0 255.255.255.0 via 0.0.0.0, connected metric [0/0]network0.0.6.136 is now variably masked   add 136.6.0.0 255.255.0.0 via 0.0.0.0, connected metric [0/0]   RIP-DB: redist 10.0.0.0 255.255.255.0(metric 0, last interface dmz1) to RIP   RIP-DB: redist 10.0.2.0 255.255.255.0(metric 0, last interface dmz1) to RIP   RIP-DB: Get redist for network 10.0.2.0   RIP-DB: adding 10.0.2.0 255.255.255.0 (metric 0) via 0.0.0.0 on Ethernet0/2.120 to RIP database   RIP-DB: rip_create_ndb create 10.0.2.0 255.255.255.0, (best metric 4294967295)   RIP-DB: rip_create_rdb Create 10.0.2.0 255.255.255.0, (metric 0) via 0.0.0.0, Ethernet0/2.120(permanent)   RIP-DB: add 10.0.2.0 255.255.255.0 (metric 0) via 0.0.0.0 on Ethernet0/2.120 (donot_age)   RIP-DB: Adding new rndb entry 10.0.2.0 255.255.255.0   RIP-DB: rip_create_ndb create 10.0.0.0 255.0.0.0, (best metric 4294967295)   RIP-DB: rip_create_rdb Create 10.0.0.0 255.0.0.0, (metric 0) via 0.0.0.0, Null0(permanent)   RIP-DB: Created rip ndb summary entry for 10.0.0.0 255.0.0.0   RIP-DB: Adding new rndb entry 10.0.0.0 255.0.0.0 rip_route_adjust for dmz1 coming up   RIP: sending request on dmz1 to 224.0.0.9 rip_route_adjust for dmz1 coming up   RIP: sending request on dmz1 to 224.0.0.9   RIP: sending v2 flash update to 224.0.0.9 via dmz1 (10.0.2.120)   RIP: build flash update entries - suppressing null update   RIP: sending v2 update to 224.0.0.9 via dmz1 (10.0.2.120)   RIP: build update entries - suppressing null update 

Now the authentication has been enabled but keys on 2 peers are not the same:

RIP: sending v2 update to 224.0.0.9 via inside (136.6.121.12)RIP: build update entries   10.0.0.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0 136.6.23.0 255.255.255.0 via 0.0.0.0, metric 2, tag 0 136.6.123.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0 136.6.124.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0   RIP: Update contains 4 routes   RIP: Update queued   RIP: sending v2 update to 224.0.0.9 via dmz1 (10.0.0.120)   RIP: build update entries   136.6.23.0 255.255.255.0 via 0.0.0.0, metric 2, tag 0 136.6.121.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0 136.6.123.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0 136.6.124.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0   RIP: Update contains 4 routes   RIP: Update queued   RIP: Update sent via inside rip-len:92   RIP: Update sent via dmz1 rip-len:92   RIP: ignored v2 packet from 136.6.123.3 (invalid authentication)   RIP: sending v2 update to 224.0.0.9 via inside (136.6.121.12)   RIP: build update entries   10.0.0.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0 136.6.23.0 255.255.255.0 via 0.0.0.0, metric 2, tag 0 136.6.123.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0 136.6.124.0 255.255.255.0 via 0.0.0.0, metric 1, tag 0   RIP: Update contains 4 routes   RIP: Update queued   RIP: sending v2 update to 224.0.0.9 via dmz1 (10.0.0.120)   RIP: build update entries 

Follow me on https://www.linkedin.com/in/yurislobodyanyuk/ not to miss what I publish on Linkedin, Github, blog, and more.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Cisco ASA RIP 路由协议 网络配置 调试
相关文章