路由策略实验
创始人
2024-09-26 09:52:59

实验拓扑

实验要求:路由选路最佳

1.如图配置IP地址

R1:

interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.0 
interface GigabitEthernet0/0/1
ip address 15.1.1.2 255.255.255.0
interface LoopBack0
ip address 1.1.1.1 255.255.255.0 
R2:

interface GigabitEthernet0/0/0
ip address 12.1.1.2 255.255.255.0 
interface GigabitEthernet0/0/1
ip address 13.1.1.1 255.255.255.0
interface LoopBack0
ip address 2.2.2.2 255.255.255.0
R3:

interface GigabitEthernet0/0/0
ip address 14.1.1.2 255.255.255.0 
interface GigabitEthernet0/0/1
ip address 15.1.1.1 255.255.255.0
interface LoopBack0
ip address 3.3.3.3 255.255.255.0
R4:

interface GigabitEthernet0/0/0
ip address 13.1.1.2 255.255.255.0 
interface GigabitEthernet0/0/1
ip address 14.1.1.1 255.255.255.0 
interface LoopBack0
ip address 4.4.4.4 255.255.255.0 
 2、抓取定向流量并在接口下执行策略

R1:

ip ip-prefix gl2 index 10 permit 3.3.3.0 24
ip ip-prefix gl2 index 30 permit 14.1.1.0 24
ip ip-prefix gl2 index 40 permit 4.4.4.4 32
ip ip-prefix gl3 index 10 permit 2.2.2.0 24
ip ip-prefix gl3 index 20 permit 13.1.1.0 24
interface GigabitEthernet0/0/0
rip metricin ip-prefix gl2 10    ——————执行名为gl2的策略,并把开销值改为10
interface GigabitEthernet0/0/1
rip metricin ip-prefix gl3 10    ——————执行名为gl3的策略,并把开销值改为10
R2:

ip ip-prefix gl index 20 deny 3.3.3.0 24
ip ip-prefix gl index 30 deny 15.1.1.0 24
ip ip-prefix gl index 40 permit 0.0.0.0 0 less-equal 32 ————前缀列表末尾隐含一条拒绝所有,在匹配前要放通所有
rip 1                       
filter-policy ip-prefix gl import GigabitEthernet0/0/0 —————在协议中调用,注意方向
R3:

ip ip-prefix gl index 20 deny 2.2.2.0 24
ip ip-prefix gl index 30 deny 12.1.1.0 24
ip ip-prefix gl index 40 deny 1.1.1.0 24
ip ip-prefix gl index 50 permit 0.0.0.0 0 less-equal 32 ————前缀列表末尾隐含一条拒绝所有,在匹配前要放通所有
rip 1                       
filter-policy ip-prefix gl import GigabitEthernet0/0/1 —————在协议中调用,注意方向

4、观察R1,R4的路由表

相关内容

热门资讯

原创 中... 在阅读文章前,辛苦您点下“关注”,方便讨论和分享。作者定会不负众望,按时按量创作出更优质的内容 文...
影石创新遭巨头“密集攻击”?刘... 来源:市场资讯 (来源:达摩财经) 影石创新日前正式发布全球首款全景无人机“影翎Antigravi...
欧盟调查谷歌利用网络内容支持A... 新华社布鲁塞尔12月9日电(记者丁英华 张兆卿)欧盟委员会9日宣布,对美国谷歌公司利用网络内容为其人...
圣奥化学公布新型绿色防老剂SA... 来源:市场资讯 (来源:中国化工信息周刊) 关键词 | 圣奥化学SA6000开发进展 共 1064字...
人工智能也有“真香定律”!从科... 潮新闻客户端 记者 谢春晖 通讯员 姜慧君 方临明 人工智能浪潮奔涌。从率先布局抢占赛道先机,到...