Static routing with BFD vs OSPF Totally Stubby on JunOS

From Iwan
Jump to: navigation, search

Last week I needed to do something in a production network where I needed to place a switch and the requirement was that the new switch should not contain all the OSPF routes that where advertised across the whole network.

So as multiple ways lead to Rome, I decided to go with OSPF totally stubby or with static routing ...

The network in particular are from Juniper and runs JunOS.

Below you will find the drawing and the configuration

Drawing

Poc.png

Configs Static with BFD

ser-dist-06

root #
set system host-name ser-dist-06
root #
set interfaces em0 unit 0 family inet address 10.10.68.6/24
set interfaces em1 unit 0 family inet address 10.10.60.6/24
set interfaces lo0 unit 2256 family inet address 6.6.6.6/24
root #
set routing-options static route 1.1.1.0/24 qualified-next-hop 10.10.60.1 bfd-liveness-detection minimum-interval 60
root #
set protocols ospf area 0.0.0.0 interface em0.0
set protocols ospf area 0.0.0.0 interface lo0.2256
root #
set policy-options policy-statement exportstatic term exportstatic1 from protocol static
set policy-options policy-statement exportstatic term exportstatic1 then accept
set protocols ospf export exportstatic
root #

ser-dist-08

root #
set system host-name ser-dist-08
root #
set interfaces em0 unit 0 family inet address 10.10.68.8/24
set interfaces em1 unit 0 family inet address 10.10.80.8/24
set interfaces lo0 unit 2257 family inet address 8.8.8.8/24
root #
set routing-options static route 1.1.1.0/24 qualified-next-hop 10.10.80.1 bfd-liveness-detection minimum-interval 60
root #
set protocols ospf area 0.0.0.0 interface em0.0
set protocols ospf area 0.0.0.0 interface lo0.2257
root #
set policy-options policy-statement exportstatic term exportstatic1 from protocol static
set policy-options policy-statement exportstatic term exportstatic1 then accept
set protocols ospf export exportstatic
root #

NEW-SWITCH

root #
set system host-name new-switch
root #
set interfaces em0 unit 0 family inet address 10.10.60.1/24
set interfaces em1 unit 0 family inet address 10.10.80.1/24
set interfaces lo0 unit 2258 family inet address 1.1.1.1/24
root #
set routing-options static route 0.0.0.0/0 qualified-next-hop 10.10.60.6
set routing-options static route 0.0.0.0/0 qualified-next-hop 10.10.80.8
set routing-options static route 0.0.0.0/0 bfd-liveness-detection minimum-interval 60
root #

Configs OSPF Totally stubby

ser-dist-06

root #
set system host-name ser-dist-06
root #
set interfaces em0 unit 0 family inet address 10.10.68.6/24
set interfaces em1 unit 0 family inet address 10.10.60.6/24
set interfaces lo0 unit 2256 family inet address 6.6.6.6/24
root #
set routing-options router-id 6.6.6.6
root #
set protocols ospf area 0.0.0.7 stub
set protocols ospf area 0.0.0.7 stub no-summaries
set protocols ospf area 0.0.0.7 stub default-metric 10
set protocols ospf area 0.0.0.7 interface em1
root #
set protocols ospf area 0.0.0.0 interface em0
set protocols ospf area 0.0.0.0 interface lo0.2256
root #

ser-dist-08

root #
set system host-name ser-dist-08
root #
set interfaces em0 unit 0 family inet address 10.10.68.8/24
set interfaces em1 unit 0 family inet address 10.10.80.8/24
set interfaces lo0 unit 2257 family inet address 8.8.8.8/24
root #
set routing-options router-id 8.8.8.8
root #
set protocols ospf area 0.0.0.7 stub
set protocols ospf area 0.0.0.7 stub no-summaries
set protocols ospf area 0.0.0.7 stub default-metric 10
set protocols ospf area 0.0.0.7 interface em1
root #
set protocols ospf area 0.0.0.0 interface em0
set protocols ospf area 0.0.0.0 interface lo0.2257
root #

NEW-SWITCH

root #
set system host-name new-switch
root #
set interfaces em0 unit 0 family inet address 10.10.60.1/24
set interfaces em1 unit 0 family inet address 10.10.80.1/24
set interfaces lo0 unit 2258 family inet address 1.1.1.1/24
root #
set routing-options router-id 1.1.1.1
root #
set protocols ospf area 0.0.0.7 stub
set protocols ospf area 0.0.0.7 interface em0
set protocols ospf area 0.0.0.7 interface em1
set protocols ospf area 0.0.0.7 interface lo0
root #

Verification

  1. Start ping from "new-switch" to 8.8.8.8
  2. Disable interface on ser-dist-06 with "set interfaces em1 disable" and "commit"
  3. Ping is still running successful
  4. Enable interface on ser-dist-06 with "delete interfaces em1 disable" and "commit"
  5. Disable interface on ser-dist-08 with "set interfaces em1 disable" and "commit"
  6. Ping is still running successful
  7. Enable interface on ser-dist-08 with "delete interfaces em1 disable" and "commit"
  8. Observation is that ping will still flow towards 8.8.8.8 if one path is broken