Dynamic routing protocols: BGP, OSPF, RIP
U
SER
G
UIDE
219
Where the default route announcement is received from
router B
(
10.45.15.220
).
With the command:
set ospf default-information originate metric 20
which announces the default route to OSPF, only if it is present on the router; the same effect is
obtained even if on
router A
the geographical connection with the POP is interrupted. As a
consequence, in this case the default route disappears and it is not propagated on OSPF.
OSPF redistribuited with BGP and BGP redistribuited with OSPF
We extend the previous configuration so that the router distributes through OSPF routes obtained
via BGP and vice versa, it redistributes via BGP routes obtained via OSPF.
In case of two routers (router A and router B), in order to avoid announcements loop, it is necessary
that router A does not announces via BGP OSPF routes received from router B, which in turn
received them through BGP.
For this reason, BGP routes redistributed via OSPF are
tagged
14
, so BGP redistributes only not
tagged OSPF routes.
The sequence of commands on
router A
is:
set bgp local-as 65201
set bgp neighbor 88.58.10.245 remote-as 3269
set bgp neighbor 88.58.10.245 description EBGP router master
set bgp redistribute ospf route-map RedOspfBGP
set bgp redistribute connected route-map ConnBGP
set bgp redistribute static route-map StatBGP
set bgp route-map ConnBGP permit 10 match ip address prefix-list LocalNetwork
set bgp route-map StatBGP permit 10 match ip address prefix-list StatRoute
set bgp ip prefix-list LocalNetwork seq 20 permit 172.20.1.221/32
set bgp ip prefix-list LocalNetwork seq 10 permit 10.45.15.192/27
set bgp ip prefix-list StatRoute seq 10 permit 44.44.0.0/16
set bgp ip prefix-list StatRoute seq 20 permit 55.55.0.0/16
set bgp route-map RedOspfBGP deny 10 match tag 1
set bgp route-map RedOspfBGP permit 20
set bgp on
set ospf router ospf router-id 10.45.15.221
set ospf network 10.45.15.192/27 area 0
set ospf redistribute bgp metric 50 metric-type 1 route-map RedBgpOSPF
set ospf route-map RedBgpOSPF permit 10 set tag 1
14
-
The tagging mechanism is available from software version 2.3.0-8