Tuesday, March 24, 2015

OSPF Walkthrough


Lets play OSPF Walkthrough



lab@vMX-1> show configuration logical-systems 
r1 {
    interfaces {
        ge-0/0/1 {
            unit 0 {
                family inet {
                    address 10.1.1.1/30;
                }
            }
        }
        lo0 {
            unit 1 {
                family inet {
                    address 1.1.1.1/32;
                    address 1.1.1.9/32 {
                        primary;
                    }
                }
            }
        }
    }
    protocols {
        ospf {
            area 0.0.0.0 {
                interface ge-0/0/1.0;
            }
        }
    }
}
r2 {
    interfaces {
        ge-0/0/2 {
            unit 0 {
                family inet {
                    address 10.1.1.2/30;
                }
            }
        }
        lo0 {
            unit 2 {
                family inet {
                    address 1.1.1.2/32;
                }
            }
        }
    }
    protocols {
        ospf {                          
            area 0.0.0.0 {
                interface ge-0/0/2.0;
            }
        }
    }
}



lab@vMX-1:r1> show ospf neighbor 
Address          Interface              State     ID               Pri  Dead
10.1.1.2         ge-0/0/1.0             Full      1.1.1.2          128    35


lab@vMX-1:r2> show ospf neighbor 
Address          Interface              State     ID               Pri  Dead
10.1.1.1         ge-0/0/2.0             Full      1.1.1.9          128    31


you can influence the ID of ospf neighbor using loopback :))

but remember router id configuration under routing options stanza will take the highest precedence.



lab@vMX-1:r1> show configuration interfaces lo0 
unit 1 {
    family inet {
        address 1.1.1.1/32;
        address 1.1.1.9/32 {
            primary;
        }
    }
}

lab@vMX-1:r1> show configuration routing-options 
router-id 1.1.1.1;



lab@vMX-1:r2> show ospf neighbor 
Address          Interface              State     ID               Pri  Dead
10.1.1.1         ge-0/0/2.0             Full      1.1.1.1          128    39





No comments:

Post a Comment