我建立了一个测试实验室,用于测试基于过滤器的转发(FBF),又称基于策略的路由。问题将在下面提出,但首先是细节:
下面是拓扑图:
目的:任何从站点1转移到目的地的流量都应通过链接2路由到WAN,而不是通过链接1。因为链接1将被两个数据中心之间的复制流量所饱和。
- SW-1和SW-2是Juniper EX4200交换机
- RTR-1和RTR-2是瞻博J4350的
- PE-1和PE-2是运行ISIS和MPLS VPN的Cisco 1841路由器,可模拟提供商WAN骨干网
SW-1,SW-2,RTR-1和RTR-2都是区域0中的OSPF邻居。RTR-1和RTR-2都是ASBR,并将BGP学习的路由注入OSPF。每个路由器都将其各自站点的路由发布到WAN中(以及为冗余而在其他站点上添加的路由)。
通过简单地将静态路由重新分配到SW-2上的Staging到具有更高度量标准的OSPF中,可以轻松完成从站点1到站点2的路由的路由。由于该路由由RTR-2通告到WAN,因此RTR-1将了解该路由并将其重新分配给度量为0的OSPF。在SW-1上从SW-2获知的OSPF路由将具有更高的度量,因此路由将比WAN更可取。
来自站点2的返回流量也需要以这种方式流动,以便我们避免非对称路由。FBF应用于进入SW-2的入站接口(链接4)。该过滤器将接收所有来自暂存(10.100.190 / 24)的流量,并生成下一跳RTR-2。正如我在实验室中测试的那样,FBF的这部分正在运行。
由于RTR-2返回站点1的首选路由是通过链路1,因此我们需要在RTR-2的入站LAN接口(面向SW-2)上再次应用FBF。
这就是问题所在……将FBF应用到该路由器时,与SW-2的OSPF邻接关系中断。
问题:为什么RTR-2和SW-2之间的OSPF邻接关系断开?
随附RTR-2和SW-2的配置:
RTR-2配置
root@RTR-2> show configuration interfaces | display set
set interfaces ge-0/0/0 unit 0 family inet filter input FBF-TEST
deactivate interfaces ge-0/0/0 unit 0 family inet filter
set interfaces ge-0/0/0 unit 0 family inet address 10.100.254.2/24
set interfaces ge-0/0/3 description "Uplink to WAN"
set interfaces ge-0/0/3 unit 0 family inet address 200.200.200.2/30
set interfaces lo0 unit 0 family inet address 10.100.199.4/32
root@RTR-2> show configuration routing-options | display set
set routing-options interface-routes rib-group inet STAGING-RIB
set routing-options rib-groups STAGING-RIB import-rib inet.0
set routing-options rib-groups STAGING-RIB import-rib PATH-1.inet.0
set routing-options rib-groups STAGING-RIB import-rib PATH-2.inet.0
set routing-options router-id 200.200.200.2
set routing-options autonomous-system 1
root@RTR-2> show configuration routing-instances | display set
set routing-instances PATH-1 instance-type forwarding
set routing-instances PATH-1 routing-options static route 10.100.30.0/24 next-hop 200.200.200.1
set routing-instances PATH-1 routing-options static route 10.100.30.0/24 qualified-next-hop 10.100.254.1 preference 100
set routing-instances PATH-2 instance-type forwarding
set routing-instances PATH-2 routing-options static route 10.100.30.0/24 next-hop 10.100.254.1
set routing-instances PATH-2 routing-options static route 10.100.30.0/24 qualified-next-hop 200.200.200.1 preference 100
root@RTR-2> show configuration firewall | display set
set firewall family inet filter FBF-TEST term TERM-1 from source-address 10.100.190.0/24
set firewall family inet filter FBF-TEST term TERM-1 from source-address 10.100.191.0/24
set firewall family inet filter FBF-TEST term TERM-1 then routing-instance PATH-1
set firewall family inet filter FBF-TEST term DEFAULT then routing-instance PATH-2
root@RTR-2> show configuration protocols | display set
set protocols bgp path-selection cisco-non-deterministic
set protocols bgp log-updown
set protocols bgp group TEST type external
set protocols bgp group TEST local-address 200.200.200.2
set protocols bgp group TEST import REJECT
set protocols bgp group TEST export ADVERTISED
set protocols bgp group TEST peer-as 65000
set protocols bgp group TEST neighbor 200.200.200.1 preference 20
set protocols ospf rib-group STAGING-RIB
set protocols ospf export BGP-to-OSPF
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 priority 150
set protocols ospf area 0.0.0.0 interface lo0.0 passive
SW-2配置
root@SW-2> show configuration interfaces | display set
set interfaces ge-0/0/0 unit 0 family inet address 10.10.10.2/30
set interfaces ge-0/0/1 unit 0 family ethernet-switching port-mode access
set interfaces ge-0/0/1 unit 0 family ethernet-switching vlan members VLAN-254
set interfaces ge-0/0/11 description "Uplink to STAGING"
set interfaces ge-0/0/11 unit 0 family inet filter input FBF-TEST
set interfaces ge-0/0/11 unit 0 family inet address 10.100.100.1/30
set interfaces lo0 unit 0 family inet address 10.100.199.2/32
set interfaces vlan unit 2 family inet address 10.100.2.1/24
set interfaces vlan unit 251 family inet address 10.100.251.1/24
set interfaces vlan unit 254 family inet address 10.100.254.1/24
root@SW-2> show configuration routing-options | display set
set routing-options nonstop-routing
set routing-options interface-routes rib-group inet STAGING-RIB
set routing-options static route 172.22.128.0/21 next-hop 10.22.76.1
set routing-options static route 10.22.20.0/24 next-hop 10.22.76.1
set routing-options static route 10.100.190.0/24 next-hop 10.100.100.2
set routing-options static route 10.100.191.0/24 next-hop 10.100.100.2
set routing-options rib-groups STAGING-RIB import-rib inet.0
set routing-options rib-groups STAGING-RIB import-rib PATH-1.inet.0
set routing-options rib-groups STAGING-RIB import-rib PATH-2.inet.0
set routing-options router-id 10.100.254.1
root@SW-2> show configuration routing-instances | display set
set routing-instances PATH-1 instance-type forwarding
set routing-instances PATH-1 routing-options static route 10.100.30.0/24 next-hop 10.100.254.2
set routing-instances PATH-1 routing-options static route 10.100.30.0/24 qualified-next-hop 10.10.10.1 preference 100
set routing-instances PATH-2 instance-type forwarding
set routing-instances PATH-2 routing-options static route 10.100.30.0/24 next-hop 10.10.10.1
set routing-instances PATH-2 routing-options static route 10.100.30.0/24 qualified-next-hop 10.100.254.2 preference 100
root@SW-2> show configuration firewall | display set
set firewall family inet filter FBF-TEST term TERM-1 from source-address 10.100.190.0/24
set firewall family inet filter FBF-TEST term TERM-1 from source-address 10.100.191.0/24
set firewall family inet filter FBF-TEST term TERM-1 then routing-instance PATH-1
set firewall family inet filter FBF-TEST term DEFAULT then routing-instance PATH-2
root@SW-2> show configuration protocols | display set
set protocols ospf export ADVERTISED
set protocols ospf area 0.0.0.0 interface ge-0/0/0.0 interface-type p2p
set protocols ospf area 0.0.0.0 interface vlan.2 passive
set protocols ospf area 0.0.0.0 interface vlan.251 passive
set protocols ospf area 0.0.0.0 interface vlan.254 priority 250