IP-Link简单实验配置

实验topo:

在这里插入图片描述

实验需求:

  1. 电信的网络走电信,联通的网络走联通。
  2. 不是电信和联通的网络默认走电信。
  3. 电信网络链路故障走联通。
  4. 联通网络链路故障走电信。

配置思路:

1.基础配置:各个接口配置IP地址,防火墙GE1/0/1为dx区,防火墙GE1/0/2为it区。

firewall zone name dx
 set priority 2
 add interface GigabitEthernet1/0/1
firewall zone name lt
 set priority 3
 add interface GigabitEthernet1/0/2

2.配置两条默认路由指向各自的网络。因为默认情况下走的是电信,所以需要调高联通的优先级(越小越优先),这里改成70。

ip route-static 0.0.0.0 0.0.0.0 202.106.1.2
ip route-static 0.0.0.0 0.0.0.0 61.67.1.2 preference 70

3.使用策略路由来实现第一个需求。

policy-based-route
 rule name DX
  source-zone trust
  destination-address isp "china telecom"
  action pbr egress-interface GigabitEthernet1/0/1 next-hop 202.106.1.2
 rule name IT
  source-zone trust
  destination-address isp "china unicom"
  track ip-link it
  action pbr egress-interface GigabitEthernet1/0/2 next-hop 61.67.1.2
#

4.需要配置IP-Link来实现对链路的监控,我们先在防火墙上开启监测功能,然后配置监测网段,出接口,监测类型。

ip-link check enable
ip-link name DX
 destination 202.106.2.1 interface GigabitEthernet1/0/1 mode icmp
ip-link name IT
 destination 61.67.2.1 interface GigabitEthernet1/0/2 mode icmp

5.配置IP-Link后发现对链路状态监测失败,原因是安全策略里面没有配置。因为是使用防火墙的出接口进行监测,所以源区域是local,目的区域是DX和IT,动作采用放行。

security-policy
 rule name a1
  source-zone local
  destination-zone DX
  destination-zone IT
  source-address 61.67.1.1 32
  source-address 202.106.1.1 32
  destination-address 61.67.2.1 32        
  destination-address 202.106.2.1 32
  action permit

6.此时,我们已经配置好了IP-Link,也配置好了去往各自网络的静态路由,这里我们需要将两者进行绑定,当IP-Link监测到Down掉的时候,切换到另一条网络。这里需要注意的是:我们对电信网进行监测的是去往电信的默认路由,而对联通网络进行监测的是去往联通网的策略路由

ip route-static 0.0.0.0 0.0.0.0 202.106.1.2 track ip-link dx
policy-based-route
 rule name it
  track ip-link IT

7.配置完上述六步后,已经可以对链路进行监测,但会遇到一个问题:当链路断开以后,即IP-Link状态变为Down,不会再恢复到UP状态(因为发给被监测链路的三次探测报文都不会通,唯一的路由已经断掉了),所以我们需要添加指向探测地址的明细路由。

ip route-static 202.106.2.1 255.255.255.0 202.106.1.2
ip route-static 61.67.12.1 255.255.255.0 61.67.1.2

8.实验结束

  • 2
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

谢泽浩

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值