Routing
Reply
Visitor
opers13
Posts: 3
Registered: ‎07-25-2008
0

Advertising networks in OSPF

[ Edited ]
All, I configured OSPF between an MX960 and a Cisco router. On the Cisco side I would advertise networks into OSPF this way:

router ospf 100
 log-adjacency-changes
 auto-cost reference-bandwidth 10000
 passive-interface default
network 10.156.0.20 0.0.0.3 area 4
 network 10.152.128.0 0.0.0.255 area 5


How do I advertise networks in JUNOS?  this is my junos OSPF config:

interfaces {
    ge-0/0/0 {
        unit 0 {
            family inet {
                address 10.156.0.21/30;
            }
        }
    }
}                   
protocols {
    ospf {
        reference-bandwidth 10g;
        area 0.0.0.4 {
            interface ge-0/0/0.0 {
                interface-type p2p;
            }

I want to create a VLAN and advertise 10.152.128.0/23 to OSPF area 0.

Just having a hard time trying to figure this out....

thanks!
Message Edited by opers13 on 10-26-2008 02:21 PM
Super Contributor
GuyDavies
Posts: 93
Registered: ‎09-26-2008
0

Re: Advertising networks in OSPF

Hi opers13,

 

Unless an interface is running OSPF (either active or passive) JUNOS uses the 'export' mechanism to inject prefixes.  These prefixes have to come from somewhere.  That can either be a local interface (not running OSPF), another routing protocol (static, rip, bgp, etc) or an aggregate route.

 

You configure it along these lines...

 

policy-options {

  policy-statement static-to-ospf {

    term t1 {

      from {

        protocol static;

        route-filter 10.156.0.20/30;

      }

      then accept;

    }

  }

}

protocols {

  ospf {

    export static-to-ospf;

  }

}

routing-options {

  static {

    route 10.156.0.20/30 discard;

  }

}

 

The discard route is similar to a route to null0 in IOS.  This creates the entry in the forwarding table for 10.156.0.20/30.  Then, you create the policy "static-to-ospf".  This policy says if you find an *active* route in the routing table with the protocol set to static then accept that.  Otherwise, reject (note, the accept/reject are purely in the sense of exporting the route into OSPF).

 

Finally, you use the export static-to-ospf command to tell OSPF to advertise routes that are matched by the policy static-to-ospf to its neighbours.

 

Now... in your config 10.150.0.20/30 is an active OSPF interface running in p2p mode in area 4.  To put 10.152.128.0/24 into area 0 (as opposed to area 5, which it is in according to your IOS config excerpt), then you just need to do the following...

 

interfaces {

  ge-0/0/0 {

    vlan-tagging;

    unit 0 {

      vlan-id 100;

      family inet {

        address 10.156.0.21/30;

      }

    }

    unit 1 {

      vlan-id 101;

      family inet {

        address 10.152.128.1/24;

      }

    }

  }

}

protocols {

  ospf {

    reference-bandwidth 10g; 

    area 0.0.0.0 {

      interface ge-0/0/0.1 {

        point-to-point;

      }

    }

    area 0.0.0.4 {

      interface ge-0/0/0.0 {

        point-to-point;

      }

    }

  }

}

 

Rgds,

 

Guy 

 

Rgds,

 

Guy 

Visitor
opers13
Posts: 3
Registered: ‎07-25-2008
0

Re: Advertising networks in OSPF

[ Edited ]

Guy,

 

I soon as I add vlan-tagging and vlan-id to the interface ge-0/0/0.0 OSPF neighbor adj. is down.

 

In junos, can I create a VLAN interface(virtual interface) assign 10.152.128.0/23 and then create the routing policy?

 

Message Edited by opers13 on 10-26-2008 04:55 PM
Super Contributor
GuyDavies
Posts: 93
Registered: ‎09-26-2008
0

Re: Advertising networks in OSPF

Hi opers13,

 

You can certainly create a policy to inject the prefix associated with an interface into OSPF.  However, I'm a bit concerned about your statement that simply turning on vlan-tagging and adding a vlan-id takes the adjacency down.  I suspect one of two things is the underlying problem.  Fix the problem and you'll get both interfaces into OSPF correctly.

 

1. The far end device isn't configured for VLAN tagging.  If you just change the Juniper box to run VLAN tagging and not the other end, then you will not be able to communicate between the devices.  Therefore, the adjacency will drop and will never recover.

 

2. Less likely is that you are inducing an MTU mismatch.  In JUNOS, the default Ethernet MTU (without vlan-tagging) is 1514.  This gives an IP MTU of 1500.  When you turn on vlan-tagging, the Ethernet MTU is changed to 1518 to accommodate the extra 4 bytes of 802.1Q header without changing the IP MTU.  Since it is the IP MTU that is used by OSPF to ensure that both sides have the same MTU, it should not have any impact.  The only problem would occur if you have manually set the MTU of the interface.  If that's the case, you'll "steal" the extra 4 bytes from the IP MTU rather than extending the Ethernet MTU to accommodate the 802.1Q header.

 

You can see if you have any communication (or if you're getting MTU mismatch) by configuring traceoptions.

 

set protocols ospf traceoptions file ospf.log files 5 size 1m

set protocols ospf traceoptions flag hello detail

set protocols ospf traceoptions flag state detail

 

You can see if you have any basic connectivity problems using 'ping' ;-)

 

Rgds,

 

Guy 

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.