华为防火墙与交换机建立两对IBGP邻居关系,使用AS 65500,防火墙上loopback1-4为模拟AS 65500中网络,为保证数据通信的可靠性和负载,完成以下配置,要求如下: 交换机通过BGP到达loopback1,2网路下一跳为10.3.0.254; 交换机通过BGP到达loopback3,4网络下一跳为10.4.0.254; 通过BGP实现到达loopback1,2,3,4的网络冗余; 使用IP前缀列表匹配上述业务数据流; 使用LP属性进行业务选路,只允许使用route-map来改变AS PATH属性属性、实现路由控制,AS PATH属性可配置的参数数值为:65505;
时间: 2024-01-24 08:18:15 浏览: 140
防火墙配置:
```
#
# loopback1-4网段配置
#
interface LoopBack 1
ip address 10.1.0.1 255.255.255.0
interface LoopBack 2
ip address 10.1.1.1 255.255.255.0
interface LoopBack 3
ip address 10.2.0.1 255.255.255.0
interface LoopBack 4
ip address 10.2.1.1 255.255.255.0
#
# BGP配置
#
bgp 65500
router-id 10.1.0.1
network 10.1.0.0 mask 255.255.255.0
network 10.1.1.0 mask 255.255.255.0
network 10.2.0.0 mask 255.255.255.0
network 10.2.1.0 mask 255.255.255.0
neighbor 10.3.0.254 remote-as 65500
neighbor 10.3.0.254 update-source LoopBack1
neighbor 10.3.0.254 next-hop-self
neighbor 10.4.0.254 remote-as 65500
neighbor 10.4.0.254 update-source LoopBack3
neighbor 10.4.0.254 next-hop-self
```
交换机配置:
```
#
# BGP配置
#
router bgp 65500
bgp log-neighbor-changes
neighbor 10.3.0.254 remote-as 65500
neighbor 10.3.0.254 next-hop-self
neighbor 10.4.0.254 remote-as 65500
neighbor 10.4.0.254 next-hop-self
#
# IP前缀列表匹配
#
ip prefix-list loopback1_2 permit 10.1.0.0/16
ip prefix-list loopback3_4 permit 10.2.0.0/16
#
# 路由控制
#
route-map AS_PATH permit 10
match ip address prefix-list loopback1_2
set as-path prepend 65505 65505 65505
route-map AS_PATH permit 20
match ip address prefix-list loopback3_4
set as-path prepend 65505 65505 65505
#
# LP属性选路
#
access-list 1 permit 10.1.0.0 0.0.1.255
access-list 2 permit 10.2.0.0 0.0.1.255
route-map LP permit 10
match ip address 1
set local-preference 200
route-map LP permit 20
match ip address 2
set local-preference 100
#
# 应用路由控制和LP属性选路
#
router bgp 65500
neighbor 10.3.0.254 route-map AS_PATH in
neighbor 10.3.0.254 route-map LP out
neighbor 10.4.0.254 route-map AS_PATH in
neighbor 10.4.0.254 route-map LP out
```
阅读全文