Hi,
I've inherited a solution that has been working for some time but now needs some changes made. i'm haveing an infuriating issue with OSPF which i think i know the solution but not willing to implement as i can't see why it works.
please see the attached pic, but here is a simple description
there are 4 routers involved, 3 vlans & 2 ospf areas & router 3 has 2 ospf processes
router 1 is a carrier cisco router running ospf in area 0, its on vlan 100 and directly connected to router 3
router 2 is a carrier cisco router running ospf in area 0, its on vlan 200 and directly connected to router 4
router 3 is an ex4200 running junos 15.1r5.5, running ospf in areas 0 & 300 on vlans 100, 200 & 300 and directly connected to router 1 vlan 100 & router 4
router 4 is an ex4200 running junos 15.1r5.5, running ospf in areas 0 & 300 on vlans 100, 200 & 300 and directly connected to router 2 vlan 200 & router 3
there is a trunk link between R3 & R4 which carries vlans 100, 200, 300 and a bunch of others.
Router 3 connects to another network via a second ospf process, ospf2.
There are a number of L3 vlans that exist on R3 that need to be reached by hosts in R4 ( & vice versa), normally this must be via the trunk link & we'd like to see this in area 300 on vlan 300.
Router configs
Router 3 Config
set routing-options router-id 240.10.100.1
set protocols ospf rib-group OSPF
set protocols ospf export OSPF2_to_OSPF
set protocols ospf export DIRECT_TO_OSPF
set protocols ospf export STATIC-TO-OSPF1
set protocols ospf area 0.0.0.0 interface vlan.200 metric 222
set protocols ospf area 0.0.0.0 interface vlan.200 priority 200
set protocols ospf area 0.0.0.0 interface vlan.100 priority 250
set protocols ospf area 0.0.0.300 interface vlan.300 priority 200
set protocols ospf area 0.0.0.300 interface vlan.137 passive
set protocols ospf area 0.0.0.300 interface vlan.142 passive
set protocols ospf area 0.0.0.300 interface vlan.145 passive
set protocols ospf area 0.0.0.300 interface vlan.146 passive
set protocols ospf area 0.0.0.300 interface vlan.147 passive
set protocols ospf area 0.0.0.300 interface vlan.152 passive
set protocols ospf area 0.0.0.300 interface vlan.153 passive
set protocols ospf area 0.0.0.300 interface vlan.154 passive
set protocols ospf area 0.0.0.300 interface vlan.903 passive
set protocols ospf area 0.0.0.300 interface vlan.904 passive
set protocols ospf area 0.0.0.300 interface vlan.135 passive
set protocols ospf area 0.0.0.300 interface vlan.136 passive
set protocols ospf area 0.0.0.300 interface vlan.140 passive
set protocols ospf area 0.0.0.300 interface vlan.141 passive
set protocols ospf area 0.0.0.300 interface vlan.165 passive
set protocols ospf area 0.0.0.300 interface vlan.180 passive
set policy-options policy-statement DIRECT_TO_OSPF term 9 from protocol direct
set policy-options policy-statement DIRECT_TO_OSPF term 9 then metric 1
set policy-options policy-statement DIRECT_TO_OSPF term 9 then tag 2
set policy-options policy-statement DIRECT_TO_OSPF term 9 then external type 1
set policy-options policy-statement DIRECT_TO_OSPF term 9 then accept
set policy-options policy-statement DIRECT_TO_OSPF2 term 9 from protocol direct
set policy-options policy-statement DIRECT_TO_OSPF2 term 9 then metric 1
set policy-options policy-statement DIRECT_TO_OSPF2 term 9 then tag 251
set policy-options policy-statement DIRECT_TO_OSPF2 term 9 then external type 1
set policy-options policy-statement DIRECT_TO_OSPF2 term 9 then accept
set policy-options policy-statement OSPF2_to_OSPF term 1 from tag 251
set policy-options policy-statement OSPF2_to_OSPF term 1 then reject
set policy-options policy-statement OSPF2_to_OSPF term 2 from protocol ospf
set policy-options policy-statement OSPF2_to_OSPF term 2 from tag 2009
set policy-options policy-statement OSPF2_to_OSPF term 2 from tag 32512
set policy-options policy-statement OSPF2_to_OSPF term 2 then external type 1
set policy-options policy-statement OSPF2_to_OSPF term 2 then accept
set policy-options policy-statement OSPF2_to_OSPF term 9 from protocol ospf
set policy-options policy-statement OSPF2_to_OSPF term 9 then tag 2
set policy-options policy-statement OSPF2_to_OSPF term 9 then external type 1
set policy-options policy-statement OSPF2_to_OSPF term 9 then accept
set policy-options policy-statement OSPF_to_OSPF2 term 1 from tag 2
set policy-options policy-statement OSPF_to_OSPF2 term 1 from tag 2009
set policy-options policy-statement OSPF_to_OSPF2 term 1 from tag 32512
set policy-options policy-statement OSPF_to_OSPF2 term 1 then reject
set policy-options policy-statement OSPF_to_OSPF2 term 9 from protocol ospf
set policy-options policy-statement OSPF_to_OSPF2 term 9 then tag 251
set policy-options policy-statement OSPF_to_OSPF2 term 9 then external type 1
set policy-options policy-statement OSPF_to_OSPF2 term 9 then accept
set policy-options policy-statement STATIC-TO-OSPF1 term 5 from instance master
set policy-options policy-statement STATIC-TO-OSPF1 term 5 from protocol static
set policy-options policy-statement STATIC-TO-OSPF1 term 5 from protocol aggregate
set policy-options policy-statement STATIC-TO-OSPF1 term 5 from tag 7700
set policy-options policy-statement STATIC-TO-OSPF1 term 5 then metric 9
set policy-options policy-statement STATIC-TO-OSPF1 term 5 then tag 7700
set policy-options policy-statement STATIC-TO-OSPF1 term 5 then external type 2
set policy-options policy-statement STATIC-TO-OSPF1 term 5 then accept
set policy-options policy-statement STATIC-TO-OSPF1 term 10 from instance master
set policy-options policy-statement STATIC-TO-OSPF1 term 10 from protocol static
set policy-options policy-statement STATIC-TO-OSPF1 term 10 from protocol aggregate
set policy-options policy-statement STATIC-TO-OSPF1 term 10 then metric 9
set policy-options policy-statement STATIC-TO-OSPF1 term 10 then external type 2
set policy-options policy-statement STATIC-TO-OSPF1 term 10 then accept
set policy-options policy-statement STATIC-TO-OSPF1 term 20 from instance OSPF2
set policy-options policy-statement STATIC-TO-OSPF1 term 20 from protocol static
set policy-options policy-statement STATIC-TO-OSPF1 term 20 from protocol aggregate
set policy-options policy-statement STATIC-TO-OSPF1 term 20 then metric 9
set policy-options policy-statement STATIC-TO-OSPF1 term 20 then tag 2
set policy-options policy-statement STATIC-TO-OSPF1 term 20 then external type 2
set policy-options policy-statement STATIC-TO-OSPF1 term 20 then accept
set policy-options policy-statement STATIC-TO-OSPF2 term 1 from instance OSPF2
set policy-options policy-statement STATIC-TO-OSPF2 term 1 from protocol static
set policy-options policy-statement STATIC-TO-OSPF2 term 1 from protocol aggregate
set policy-options policy-statement STATIC-TO-OSPF2 term 1 then metric 9
set policy-options policy-statement STATIC-TO-OSPF2 term 1 then external type 2
set policy-options policy-statement STATIC-TO-OSPF2 term 1 then accept
set policy-options policy-statement STATIC-TO-OSPF2 term 2 from instance master
set policy-options policy-statement STATIC-TO-OSPF2 term 2 from protocol static
set policy-options policy-statement STATIC-TO-OSPF2 term 2 from protocol aggregate
set policy-options policy-statement STATIC-TO-OSPF2 term 2 then metric 9
set policy-options policy-statement STATIC-TO-OSPF2 term 2 then tag 251
set policy-options policy-statement STATIC-TO-OSPF2 term 2 then external type 2
set policy-options policy-statement STATIC-TO-OSPF2 term 2 then accept
set routing-instances OSPF2 interface vlan.570
set routing-instances OSPF2 routing-options interface-routes rib-group inet OSPF2
set routing-instances OSPF2 routing-options static rib-group OSPF2
set routing-instances OSPF2 routing-options router-id 240.10.100.1
set routing-instances OSPF2 protocols ospf rib-group OSPF2
set routing-instances OSPF2 protocols ospf export OSPF_to_OSPF2
set routing-instances OSPF2 protocols ospf export STATIC-TO-OSPF2
set routing-instances OSPF2 protocols ospf export DIRECT_TO_OSPF2
set routing-instances OSPF2 protocols ospf export STATIC-TO-OSPF1
set routing-instances OSPF2 protocols ospf area 0.0.0.0 interface vlan.570
All Vlans mentioned are l3-interface
Router 4 config
set routing-options router-id 240.10.200.17
set protocols ospf export STATIC-TO-OSPF
set protocols ospf area 0.0.0.0 interface vlan.100 metric 10
set protocols ospf area 0.0.0.0 interface vlan.100 priority 200
set protocols ospf area 0.0.0.0 interface vlan.874 passive
set protocols ospf area 0.0.0.0 interface vlan.200 priority 250
set protocols ospf area 0.0.0.300 interface vlan.300 priority 250
set protocols ospf area 0.0.0.300 interface vlan.95 passive
set protocols ospf area 0.0.0.300 interface vlan.220 passive
set protocols ospf area 0.0.0.300 interface vlan.66 passive
set protocols ospf area 0.0.0.300 interface vlan.32 passive
set protocols ospf area 0.0.0.300 interface vlan.125 passive
set protocols ospf area 0.0.0.300 interface vlan.205 passive
set protocols ospf area 0.0.0.300 interface vlan.206 passive
set protocols ospf area 0.0.0.300 interface vlan.207 passive
set protocols ospf area 0.0.0.300 interface vlan.210 passive
set protocols ospf area 0.0.0.300 interface vlan.211 passive
set protocols ospf area 0.0.0.300 interface vlan.212 passive
set protocols ospf area 0.0.0.300 interface vlan.216 passive
set protocols ospf area 0.0.0.300 interface vlan.217 passive
set policy-options policy-statement STATIC-TO-OSPF term match-internal-static from protocol static
set policy-options policy-statement STATIC-TO-OSPF term match-internal-static from protocol aggregate
set policy-options policy-statement STATIC-TO-OSPF term match-internal-static then metric 10
set policy-options policy-statement STATIC-TO-OSPF term match-internal-static then external type 2
set policy-options policy-statement STATIC-TO-OSPF term match-internal-static then accept
All Vlans mentioned are l3-interface
In order for the carrier to send traffic into the the correct DC router they need us to add appropriate tags to the ospf routes we advertise to them. Currently in DC1-VC, all vlans declared passive in area 300 (set protocols ospf area 0.0.0.300 interface vlan.XXX passive) are not tagged. no matter what i try i can't get them tagged & our carrier is sending traffic for them via DC2 as untagged traffic is prefered via that route.
DC2-VC chooses to send traffic for these vlans across vlan 300 in area 300, if i vlan 300 it then chooses either vlan 100 or vlan 200, reverting to vlan 300 once its reenabled, this is desirable and expected.
Vlans i remove from area 200 declaration get tagged just fine.
The problem is that we have seen DC2-VC prefer to send non declared vlans via the carrier routers in area0 vlans 100 & 200 rather than across area 300 vlan 300 while at the same time routing declared vlans across vlan 300. Our fix is to add the vlan to the declaration on DC1-VC but we then loose tagging and the carrier sends traffic for DC1 via DC2.
the strange thing is that testing in my lab removing the area 300 declaration and clearing ospf, DC2 initially prefers vlan 100 or 200 then settles on vlan 300.
the aim is to enable directly connected vlans in DC1-VC to be reached by DC2-VC via area 300 across the trunk and for those same directly connected vlans to be tagged so the carrier routers can take appropriate actions.
it looks like i just need to remove the area 300 declarations, but i can't see why DC2-VC prefers to send traffic across area 300 instead of area 0.
I'd be grateful for an explanation and perhaps some advice on streamlining this whole thing (i.e i think i coudl remove set routing-instances OSPF2 protocols ospf export STATIC-TO-OSPF1 as i think its a duplication)
Thanks In Advance