6.2 防火墙多出口高可用

图片[1]-6.2 防火墙多出口高可用-大赛人网

1.R1配置

bgp 100
 peer 89.89.89.9 as-number 200 
  network 13.1.1.0 255.255.255.0 
  network 88.8.0.0 255.255.255.0 
  network 88.8.1.0 255.255.255.0 

2.R2配置

bgp 200
 peer 89.89.89.8 as-number 100 
  network 23.1.1.0 255.255.255.0 
  network 99.9.0.0 255.255.255.0 
  network 99.9.1.0 255.255.255.0 

3.R3配置

#去往内网路由
ip route-static 192.168.1.0 24 GigabitEthernet 0/0/0 10.1.11.2
ip route-static 192.168.2.0 24 GigabitEthernet 0/0/0 10.1.11.2

#配置去往外网路由(主备架构)
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet 0/0/1 13.1.1.1 #preference默认60
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet 0/0/2 23.1.1.2 preference 100

#查看路由
display ip routing-table protocol static
Public routing table : Static
         Destinations : 3        Routes : 4        Configured Routes : 4

Static routing table status : <Active>
         Destinations : 3        Routes : 3

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  60   0           D   13.1.1.1        GigabitEthernet0/0/1
    192.168.1.0/24  Static  60   0           D   10.1.11.2       GigabitEthernet0/0/0
    192.168.2.0/24  Static  60   0           D   10.1.11.2       GigabitEthernet0/0/0

Static routing table status : <Inactive>
         Destinations : 1        Routes : 1

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   Static  100  0               23.1.1.2        GigabitEthernet0/0/2

#配置acl
acl number 2000  
 rule 10 permit source 192.168.1.0 0.0.0.255 
 rule 20 permit source 192.168.2.0 0.0.0.255 
interface GigabitEthernet0/0/1
 nat outbound 2000
interface GigabitEthernet0/0/2
 nat outbound 2000

4.SW1配置

vlan batch 10  11 20

interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 10

interface GigabitEthernet0/0/2
 port link-type access
 port default vlan 20

interface GigabitEthernet0/0/24
 port link-type access
 port default vlan 11

interface Vlanif10
 ip address 192.168.1.254 255.255.255.0

interface Vlanif11
 ip address 10.1.11.2 255.255.255.0

interface Vlanif20
 ip address 192.168.2.254 255.255.255.0

#默认路由
ip route-static 0.0.0.0 0.0.0.0 Vlanif11 10.1.11.1

5.网络质量健康检测(路由器),在主备路由切换时,增加条件, 网络健康检测-检测故障后,也可以做主备切换。bfd 双向转发检测,双向检测/单向检测。

图片[2]-6.2 防火墙多出口高可用-大赛人网
1)R3配置
bfd# 全局下激活BFD功能
quit
bfd 1 bind peer-ip 13.1.1.1 interface GigabitEthernet 0/0/1 one-arm-echo #单臂回声检测
 discriminator local 1
 commit
#在主备架构中,主线路建议做健康状态检测, 备线路可以不做。

#路由绑定bdf
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1

6.负载均衡

图片[3]-6.2 防火墙多出口高可用-大赛人网
1)删除原有路由(含优先级)
undo ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/1 13.1.1.1
undo ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/2 23.1.1.2

2)在负载架构中,双线路全部建议做健康状态检测
bfd 1 bind peer-ip 13.1.1.1 interface GigabitEthernet0/0/1 one-arm-echo
 discriminator local 1
 Commit

bfd 2 bind peer-ip 23.1.1.2 interface GigabitEthernet0/0/2 one-arm-echo
 discriminator local 2
 Commit

3)添加默认路由(绑定健康检测)
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2

4)在路由器中,如果路由表中,路由方式为负载均衡,流量出口选择方式,将数据流量,根据流量中的地址进行哈希运算 mac/ip,得到哈希值,不同IP地址,哈希值不同 (类似随机),根据哈希值匹配出接口,当数据流量足够多时,哈希算法能够平均分配流量。默认情况下,基于路由器负载均衡,无法针对运营商数据进行匹配。
load-balance ?         
  dst-ip       According to destination IP hash arithmetic
  dst-mac      According to destination MAC hash arithmetic
  src-dst-ip   According to source/destination IP hash arithmetic
  src-dst-mac  According to source/destination MAC hash arithmetic
  src-ip       According to source IP hash arithmetic
  src-mac      According to source MAC hash arithmetic


5)基于路由器-负载均衡干预问题
基于目的 -的负载 (1.明细路由方式 | 2.基于DNS方式)
去往联通- 从联通出口出去, 去往电信- 从电信出口出去
去往其他运营商的流量使用路由器自动匹配出口
基于源-的负载 (策略路由方式)

7.基于明细路由方式的路由器-基于目的负载均衡干预

1)配置外网1方向明细路由
88.8.0.0/24
88.8.1.0/24
ip route-static 88.8.0.0 255.255.255.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1
ip route-static 88.8.1.0 255.255.255.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1

2)配置外网2方向明细路由
99.9.0.0/24
99.9.1.0/24
ip route-static 99.9.0.0 255.255.255.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2
ip route-static 99.9.1.0 255.255.255.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2

3)查看路由
display current-configuration | include route-static
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2
ip route-static 88.8.0.0 255.255.255.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1
ip route-static 88.8.1.0 255.255.255.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1
ip route-static 99.9.0.0 255.255.255.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2
ip route-static 99.9.1.0 255.255.255.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2
ip route-static 192.168.1.0 255.255.255.0 GigabitEthernet0/0/0 10.1.11.2
ip route-static 192.168.2.0 255.255.255.0 GigabitEthernet0/0/0 10.1.11.2

8.基于策略路由方式的路由器-基于源的负载均衡干预

1)ACL 匹配源的流量
acl number 2001  
 rule 10 permit source 192.168.1.0 0.0.0.255 
acl number 2002  
 rule 10 permit source 192.168.2.0 0.0.0.255

2)策略路由
(1)流量类型
traffic classifier vlan10 
 if-match acl 2001

traffic classifier vlan20 
 if-match acl 2002


(2)流量行为
traffic behavior vlan10
 redirect ip-nexthop 13.1.1.1

traffic behavior vlan20
 redirect ip-nexthop 23.1.1.2

(3)流量策略
traffic policy pbr
 classifier vlan10 behavior vlan10
 classifier vlan20 behavior vlan2

(4)在接口调用流量策略
interface GigabitEthernet0/0/0
 traffic-policy pbr inbound

9.基于路由器/网络质量健康检测

1)bfd用于检测静态路由
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2
ip route-static 88.8.0.0 255.255.255.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1
ip route-static 88.8.1.0 255.255.255.0 GigabitEthernet0/0/1 13.1.1.1 track bfd-session 1
ip route-static 99.9.0.0 255.255.255.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2
ip route-static 99.9.1.0 255.255.255.0 GigabitEthernet0/0/2 23.1.1.2 track bfd-session 2

2)nqa 可以关联策略路由/静态路由
(1)配置外网1的nqa
nqa test-instance isp01 ping 
 test-type icmp
 destination-address ipv4 13.1.1.1
 frequency 5
 # 测试频率
 interval seconds 1
 # 两个数据包之间时间间隔
 timeout 1 
# 超时时间
 probe-count 5 
# 一次测试 消息数量
 start now 
# 立即测试

#流量行为绑定nqa
traffic behavior vlan10
 redirect ip-nexthop 13.1.1.1 track nqa isp01 ping

display nqa results test-instance isp01 ping

(2)配置外网2的nqa
nqa test-instance isp02 ping 
 test-type icmp
 destination-address ipv4 23.1.1.2
 frequency 5 
# 测试频率
 interval seconds 1 
# 两个数据包之间时间间隔
 timeout 1 
# 超时时间
 probe-count 5
 #一次测试 消息数量
 start now 
# 立即测试

#流量行为绑定nqa
traffic behavior vlan20
 redirect ip-nexthop 23.1.1.2 track nqa isp02 ping

display nqa results test-instance isp02 ping

display bfd session all 
Local Remote     PeerIpAddr      State     Type        InterfaceName            
1     -          13.1.1.1        Up        S_IP_IF     GigabitEthernet0/0/1     
2     -          23.1.1.2        Up        S_IP_IF     GigabitEthernet0/0/2     
© 版权声明
THE END
喜欢就支持一下吧
点赞15 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称

    请登录后查看评论内容