Tuesday, August 19, 2014

Filtering routes in Juniper


protocols {
    rip {
        group RIP-PROTOCOL {
            neighbor em0.0;
            neighbor em1.0 {
                import RIP-FILTER;
            }
        }
    }
}

    }
 
    policy-statement RIP-FILTER {
        term FL-ROUTES {
            from {
                protocol rip;
                route-filter 8.8.8.0/24 exact;
            }
            then reject;
        }
    }
}



set policy-options policy-statement RIP-FILTER term FL-ROUTES from protocol rip
set policy-options policy-statement RIP-FILTER term FL-ROUTES from route-filter 8.8.8.0/24 exact
set policy-options policy-statement RIP-FILTER term FL-ROUTES then reject

set protocols rip group RIP-PROTOCOL neighbor em1.0 import RIP-FILTER


Juniper RIP

Configuring Rip in Juniper.


Configuring routing protocol in juniper is a three step process.


1. Create a policy to enable rip on the interfaces

2.Create the policy to advertise directly connected or rip learnt routes

3. Apply the step one policy


Configuration.


1.
set protocols rip group RIP-PROTOCOL neighbor em0.0
set protocols rip group RIP-PROTOCOL neighbor em1.0

2.
set policy-options policy-statement RIP-ADVERTISEMENT-CUSTOM from protocol direct
set policy-options policy-statement RIP-ADVERTISEMENT-CUSTOM from protocol rip
set policy-options policy-statement RIP-ADVERTISEMENT-CUSTOM then accept

3.
set protocols rip group RIP-PROTOCOL export RIP-ADVERTISEMENT-CUSTOM


Xml Output

protocols {
    rip {
        group RIP-PROTOCOL {
            export RIP-ADVERTISEMENT-CUSTOM;
            neighbor em0.0;
            neighbor em1.0;
        }
    }
}
policy-options {
        policy-statement RIP-ADVERTISEMENT-CUSTOM {
        from protocol [ direct rip ];
        then accept;
}