Saturday, March 14, 2015

RIP basic config on JunOS, IOS, IOS-XR

topology:

  1. Configure rip protocol in JunOS1, R1, IOS-XR.

root@test# top show
protocols {
    rip {
        group RIP {
            export PERMIT;
            neighbor em0.0;
        }
    }
}
policy-options {
    policy-statement PERMIT {
        then accept;

R1#show run | se router
router rip
 version 2
 network 1.0.0.0
 network 10.0.0.0
 no auto-summary
RP/0/0/CPU0:ios#show run router rip
Sat Mar 14 20:57:47.301 UTC
router rip
 interface Loopback0
 !
 interface GigabitEthernet0/0/0/2
 !
!


root@test# run show route protocol rip

inet.0: 8 destinations, 8 routes (8 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.0/24         *[RIP/100] 00:07:18, metric 2, tag 0
                    > to 10.1.13.1 via em0.0
2.2.2.0/24         *[RIP/100] 00:06:24, metric 3, tag 0
                    > to 10.1.13.1 via em0.0
10.1.12.0/24       *[RIP/100] 00:07:18, metric 2, tag 0
                    > to 10.1.13.1 via em0.0
224.0.0.9/32       *[RIP/100] 00:03:22, metric 1
                      MultiRecv

__juniper_private2__.inet.0: 1 destinations, 1 routes (0 active, 0 holddown, 1 hidden)

---------------------------------------------------------------------------------------------------------

RP/0/0/CPU0:ios#show route rip
Sat Mar 14 21:14:00.045 UTC

R    1.1.1.0/24 [120/1] via 10.1.12.1, 00:20:59, GigabitEthernet0/0/0/2
R    3.3.3.0/24 [120/2] via 10.1.12.1, 00:01:26, GigabitEthernet0/0/0/2
R    3.3.3.3/32 [120/2] via 10.1.12.1, 00:01:26, GigabitEthernet0/0/0/2
R    10.1.13.0/24 [120/1] via 10.1.12.1, 00:20:59, GigabitEthernet0/0/0/2
RP/0/0/CPU0:ios#

  1. Config filtering network 1.1.1.0/24 in routing table JunOS and IOS-XR

root@test# top show
protocols {
    rip {
        group RIP {
            export PERMIT;
            import DENY_NETWORK_LO;
            neighbor em0.0;
        }
    }
}
policy-options {
    prefix-list DENY_L0_R1 {
        1.1.1.0/24;
    }
    policy-statement DENY_NETWORK_LO {
        term TERM1 {
            from {
                prefix-list DENY_L0_R1;
            }
            then reject;
        }
        term TERM2 {
            then accept;
        }
    }
}
RP/0/0/CPU0:ios#show running-config
prefix-set DENY_L0_R1
  1.1.1.0/24
end-set
!
route-policy DENY_NETWORK_LO
  if destination in DENY_L0_R1 then
    drop
  endif
  pass
end-policy
!
router rip
 interface Loopback0
 !
 interface GigabitEthernet0/0/0/2
 !
 route-policy DENY_NETWORK_LO in
!

Let's verify routing table:

root@test# run show route protocol rip

inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

2.2.2.0/24         *[RIP/100] 01:13:24, metric 3, tag 0
                    > to 10.1.13.1 via em0.0
10.1.12.0/24       *[RIP/100] 01:14:18, metric 2, tag 0
                    > to 10.1.13.1 via em0.0
224.0.0.9/32       *[RIP/100] 00:11:37, metric 1
                      MultiRecv

__juniper_private2__.inet.0: 1 destinations, 1 routes (0 active, 0 holddown, 1 hidden)

[edit protocols rip group RIP]


RP/0/0/CPU0:ios#show ip route rip
Sat Mar 14 22:07:21.555 UTC

R    3.3.3.0/24 [120/2] via 10.1.12.1, 00:21:11, GigabitEthernet0/0/0/2
R    3.3.3.3/32 [120/2] via 10.1.12.1, 00:21:11, GigabitEthernet0/0/0/2
R    10.1.13.0/24 [120/1] via 10.1.12.1, 00:21:11, GigabitEthernet0/0/0/2


=> Network 1.1.1.0/24 had been filter in JunOS and IOS-XR

No comments:

Post a Comment