Distribute list in out direction – OSPF

Distribute list in out direction – OSPF


R1:-
interface Loopback0
 ip address 1.1.1.1
255.255.255.255
 interface
FastEthernet0/0
Description “Connected to R5”
 ip address
15.15.15.1 255.255.255.0
no shut
interface FastEthernet0/1
Description “Connected to R3”
 ip address
13.13.13.1 255.255.255.0
no shut
interface FastEthernet1/0
Description “Connected to R2”
 ip address
12.12.12.1 255.255.255.0
no shut
router eigrp 1
 network 15.15.15.1
0.0.0.0
 redistribute ospf
1 metric 1 1 1 1 1
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 redistribute eigrp
1 subnets
 network 12.12.12.1
0.0.0.0 area 0
 network 13.13.13.1
0.0.0.0 area 0
 distribute-list
Block_5.5.5.5/32 out   \ Distribute list in out direction can be used to filter external routes. This Distribution list is preventing 5.5.5.5/32
ip access-list standard Block_5.5.5.5/32
 deny   5.5.5.5
 permit any
R2:-
nterface Loopback0
 ip address 2.2.2.2
255.255.255.255
interface Loopback1
 ip address
20.1.1.2 255.255.255.0
 ip ospf network
point-to-point
interface Loopback2
 ip address
20.1.2.2 255.255.255.0
 ip ospf network
point-to-point
interface FastEthernet1/0
Description “Connected to R1”
 ip address
12.12.12.2 255.255.255.0
no shut
router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 network 12.12.12.2
0.0.0.0 area 0
 network 20.1.1.2
0.0.0.0 area 0
 network 20.1.2.2
0.0.0.0 area 0
R3:-
interface Loopback0
 ip address 3.3.3.3
255.255.255.255
interface FastEthernet0/1
Description “Connected to R1”
 ip address
13.13.13.3 255.255.255.0
no shut
interface FastEthernet1/0
Description “Connected to R4”
 ip address
34.34.34.3 255.255.255.0
 no shut
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 network 13.13.13.3
0.0.0.0 area 0
 network 34.34.34.3
0.0.0.0 area 1
R4:-
interface Loopback0
 ip address 4.4.4.4
255.255.255.255
interface FastEthernet0/0
Description “Connected to R6”
 ip address
46.46.46.4 255.255.255.0
no shut
interface FastEthernet1/0
Description “Connected to R3”
 ip address
34.34.34.4 255.255.255.0
router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 network 34.34.34.4
0.0.0.0 area 1
 network 46.46.46.4
0.0.0.0 area 1
R5:-
interface Loopback0
 ip address 5.5.5.5
255.255.255.255
interface Loopback1
 ip address
55.55.55.55 255.255.255.255
!
interface FastEthernet0/0
Description “Connected to R1”
 ip address
15.15.15.5 255.255.255.0
router eigrp 1
 network 5.5.5.5
0.0.0.0
network 55.55.55.55 0.0.0.0
 network 15.15.15.5
0.0.0.0
Verification:-
R1:-
R1#sh ip ospf neighbor
Neighbor ID    
Pri   State           Dead Time   Address         Interface
3.3.3.3          
1   FULL/BDR        00:00:37    13.13.13.3      FastEthernet0/1
2.2.2.2          
1   FULL/BDR        00:00:31    12.12.12.2      FastEthernet1/0
R1#sh ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(1)
H   Address                 Interface       Hold Uptime   SRTT  
RTO  Q  Seq
                                           
(sec)         (ms)       Cnt Num
0   15.15.15.5              Fa0/0             10 00:06:10  111  
666  0  7
R1#
R1#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override
Gateway of last resort is not set
      1.0.0.0/32 is
subnetted, 1 subnets
C        1.1.1.1 is
directly connected, Loopback0
      5.0.0.0/32 is
subnetted, 1 subnets
D        5.5.5.5
[90/156160] via 15.15.15.5, 00:06:13, FastEthernet0/0
      6.0.0.0/32 is
subnetted, 1 subnets
O IA     6.6.6.6
[110/4] via 13.13.13.3, 20:53:56, FastEthernet0/1
      12.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
12.12.12.0/24 is directly connected, FastEthernet1/0
L       
12.12.12.1/32 is directly connected, FastEthernet1/0
      13.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
13.13.13.0/24 is directly connected, FastEthernet0/1
L       
13.13.13.1/32 is directly connected, FastEthernet0/1
      15.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
15.15.15.0/24 is directly connected, FastEthernet0/0
L       
15.15.15.1/32 is directly connected, FastEthernet0/0
      20.0.0.0/24
is subnetted, 2 subnets
O        20.1.1.0
[110/2] via 12.12.12.2, 22:24:01, FastEthernet1/0
O        20.1.2.0
[110/2] via 12.12.12.2, 22:22:42, FastEthernet1/0
      34.0.0.0/24
is subnetted, 1 subnets
O IA     34.34.34.0
[110/2] via 13.13.13.3, 21:05:58, FastEthernet0/1
      46.0.0.0/24
is subnetted, 1 subnets
O IA     46.46.46.0
[110/3] via 13.13.13.3, 20:53:56, FastEthernet0/1
R1#
R2:-
R2# sh ip ospf neighbor
Neighbor ID    
Pri   State           Dead Time   Address         Interface
1.1.1.1          
1   FULL/DR         00:00:31    12.12.12.1      FastEthernet1/0
R2#sh ip route  \ No 5.5.5.5/32 route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP, EX – EIGRP external, O – OSPF, IA
– OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override
Gateway of last resort is not set
      2.0.0.0/32 is
subnetted, 1 subnets
C        2.2.2.2 is
directly connected, Loopback0
      6.0.0.0/32 is
subnetted, 1 subnets
O IA     6.6.6.6
[110/5] via 12.12.12.1, 20:53:25, FastEthernet1/0
      12.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
12.12.12.0/24 is directly connected, FastEthernet1/0
L       
12.12.12.2/32 is directly connected, FastEthernet1/0
      13.0.0.0/24
is subnetted, 1 subnets
O        13.13.13.0
[110/2] via 12.12.12.1, 22:22:12, FastEthernet1/0
      15.0.0.0/24 is
subnetted, 1 subnets
O E2     15.15.15.0
[110/20] via 12.12.12.1, 17:02:59, FastEthernet1/0
      20.0.0.0/8 is
variably subnetted, 4 subnets, 2 masks
C       
20.1.1.0/24 is directly connected, Loopback1
L       
20.1.1.2/32 is directly connected, Loopback1
C       
20.1.2.0/24 is directly connected, Loopback2
L       
20.1.2.2/32 is directly connected, Loopback2
      34.0.0.0/24
is subnetted, 1 subnets
O IA     34.34.34.0
[110/3] via 12.12.12.1, 21:05:27, FastEthernet1/0
      46.0.0.0/24
is subnetted, 1 subnets
O IA     46.46.46.0
[110/4] via 12.12.12.1, 20:53:25, FastEthernet1/0
R2#
R3:-
R3#sh ip ospf neighbor
Neighbor ID    
Pri   State           Dead Time   Address         Interface
1.1.1.1          
1   FULL/DR         00:00:38    13.13.13.1 
    FastEthernet0/1
4.4.4.4          
1   FULL/BDR        00:00:39    34.34.34.4      FastEthernet1/0
R3#sh ip route    \ No 5.5.5.5/32 route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override
Gateway of last resort is not set
      3.0.0.0/32 is
subnetted, 1 subnets
C        3.3.3.3 is
directly connected, Loopback0
      6.0.0.0/32 is
subnetted, 1 subnets
O        6.6.6.6
[110/3] via 34.34.34.4, 20:55:35, FastEthernet1/0
      12.0.0.0/24
is subnetted, 1 subnets
O        12.12.12.0
[110/2] via 13.13.13.1, 22:47:58, FastEthernet0/1
      13.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
13.13.13.0/24 is directly connected, FastEthernet0/1
L       
13.13.13.3/32 is directly connected, FastEthernet0/1
      15.0.0.0/24
is subnetted, 1 subnets
O E2     15.15.15.0
[110/20] via 13.13.13.1, 17:04:58, FastEthernet0/1
      20.0.0.0/24
is subnetted, 2 subnets
O        20.1.1.0
[110/3] via 13.13.13.1, 22:25:39, FastEthernet0/1
O        20.1.2.0
[110/3] via 13.13.13.1, 22:24:20, FastEthernet0/1
      34.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
34.34.34.0/24 is directly connected, FastEthernet1/0
L       
34.34.34.3/32 is directly connected, FastEthernet1/0
      46.0.0.0/24
is subnetted, 1 subnets
O        46.46.46.0
[110/2] via 34.34.34.4, 20:55:35, FastEthernet1/0
R4:-
R4#sh ip ospf neighbor
Neighbor ID    
Pri   State           Dead Time   Address         Interface
3.3.3.3          
1   FULL/DR         00:00:32    34.34.34.3      FastEthernet1/0
6.6.6.6          
1   FULL/DR         00:00:35    46.46.46.6      FastEthernet0/0
R4#sh ip rou
R4#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override
Gateway of last resort is not set
      4.0.0.0/32 is
subnetted, 1 subnets
C        4.4.4.4 is
directly connected, Loopback0
      6.0.0.0/32 is
subnetted, 1 subnets
O        6.6.6.6
[110/2] via 46.46.46.6, 00:07:07, FastEthernet0/0
      12.0.0.0/24
is subnetted, 1 subnets
O IA     12.12.12.0
[110/3] via 34.34.34.3, 00:07:07, FastEthernet1/0
      13.0.0.0/24
is subnetted, 1 subnets
O IA     13.13.13.0
[110/2] via 34.34.34.3, 00:07:07, FastEthernet1/0
      15.0.0.0/24
is subnetted, 1 subnets
O E2     15.15.15.0
[110/20] via 34.34.34.3, 00:07:07, FastEthernet1/0
      20.0.0.0/24
is subnetted, 2 subnets
O IA     20.1.1.0
[110/4] via 34.34.34.3, 00:07:07, FastEthernet1/0
O IA     20.1.2.0
[110/4] via 34.34.34.3, 00:07:07, FastEthernet1/0
      34.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
34.34.34.0/24 is directly connected, FastEthernet1/0
L       
34.34.34.4/32 is directly connected, FastEthernet1/0
      46.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
46.46.46.0/24 is directly connected, FastEthernet0/0
L       
46.46.46.4/32 is directly connected, FastEthernet0/0
R4#
R5:-
R5#sh ip eigrp neighbors
EIGRP-IPv4 Neighbors for AS(1)
H   Address                 Interface       Hold Uptime   SRTT  
RTO  Q  Seq
                                           
(sec)         (ms)       Cnt Num
0   15.15.15.1              Fa0/0             12 00:12:16  481  2886  0  7
R5#sh ip rou
R5#sh ip route
Codes: L – local, C – connected, S – static, R – RIP, M –
mobile, B – BGP
       D – EIGRP,
EX – EIGRP external, O – OSPF, IA – OSPF inter area
       N1 – OSPF
NSSA external type 1, N2 – OSPF NSSA external type 2
       E1 – OSPF
external type 1, E2 – OSPF external type 2
       i – IS-IS,
su – IS-IS summary, L1 – IS-IS level-1, L2 – IS-IS level-2
       ia – IS-IS
inter area, * – candidate default, U – per-user static route
       o – ODR, P –
periodic downloaded static route, H – NHRP
       + –
replicated route, % – next hop override
Gateway of last resort is not set
      5.0.0.0/32 is
subnetted, 1 subnets
C        5.5.5.5 is
directly connected, Loopback0
      6.0.0.0/32 is
subnetted, 1 subnets
D EX     6.6.6.6
[170/2560002816] via 15.15.15.1, 00:12:17, FastEthernet0/0
      12.0.0.0/24
is subnetted, 1 subnets
D EX     12.12.12.0
[170/2560002816] via 15.15.15.1, 00:12:17, FastEthernet0/0
      13.0.0.0/24
is subnetted, 1 subnets
D EX     13.13.13.0
[170/2560002816] via 15.15.15.1, 00:12:17, FastEthernet0/0
      15.0.0.0/8 is
variably subnetted, 2 subnets, 2 masks
C       
15.15.15.0/24 is directly connected, FastEthernet0/0
L       
15.15.15.5/32 is directly connected, FastEthernet0/0
      20.0.0.0/24
is subnetted, 2 subnets
D EX     20.1.1.0
[170/2560002816] via 15.15.15.1, 00:12:17, FastEthernet0/0
D EX     20.1.2.0
[170/2560002816] via 15.15.15.1, 00:12:17, FastEthernet0/0
      34.0.0.0/24
is subnetted, 1 subnets
D EX     34.34.34.0
[170/2560002816] via 15.15.15.1, 00:12:17, FastEthernet0/0
      46.0.0.0/24
is subnetted, 1 subnets

D EX     46.46.46.0
[170/2560002816] via 15.15.15.1, 00:12:17, FastEthernet0/]