Thursday, 14 August 2025

What is IP prefix-list? How to configure IP prefix-list?

 IP Prefix List

An IP prefix list is a network filtering tool used primarily in routing protocols to control which routes are accepted or rejected based on their network prefixes.

Key Characteristics

·        Prefix-based filtering: Matches routes based on their network address and prefix length.

·        Ordering processing: Entries are processed top-down until a match is found.

·        Implicit deny: if no match is found, the prefix is denied by default

 

R1(config)#ip prefix-list NAME seq 10 deny 192.168.1.1/24?

  ge  Minimum prefix length to be matched

  le  Maximum prefix length to be matched

  <cr>

Parameters

·        Network/len: The network address and prefix length to match.

·        Ge: “greater than or equal to” – minimum prefix length to match.

·        Le: “less than or equal to” – maximum prefix length to match.

·        Seq: optional sequence number for ordering entries.

Prefix lists are widely used in routing protocols like BGP, OSPF, and EIGRP for precise control over route advertisements and redistributions


Topology:-


Goal:.Configure the topology as per the diagram

  1. Configure the IP addresses as per the topology
  2. Configure IGP protocol EIGRP 100
  3. Advertise the directly connected routes 
  4. configure IP Prefix list name INTERNET
  5. Deny 192.168.31.0/24 - 192.168.32.0/24
  6. rest permit
  7. deny 192.168.11.0/24 adjust the SEQ number.
  8. make sure router 2 deny192.168.31.1/24 & 192.168.32.1/24 and 192.168.11.1/24 
  9. change the SEQ

R1(config)#interface serial 5/0
R1(config-if)#ip address 12.1.1.1 255.0.0.0
R1(config-if)#no shutdown
R1(config-if)#exit

R1(config)#interface loopback 1
R1(config-if)#ip address 192.168.11.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 2
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 3
R1(config-if)#ip address 192.168.13.1 255.255.255.0
R1(config-if)#exit
R1(config)#interface loopback 4
R1(config-if)#ip address 192.168.14.1 255.2/55.255.0
R1(config-if)#exit

R2(config)#interface serial 5/0
R2(config-if)#ip address 12.1.1.2 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#interface serial 5/1
R2(config-if)#ip address 13.1.1.1 255.0.0.0
R2(config-if)#no shutdown
R2(config-if)#exit

R2(config)#interface loopback 1
R2(config-if)#ip address 192.168.21.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 2
R2(config-if)#ip address 192.168.22.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 3
R2(config-if)#ip address 192.168.23.1 255.255.255.0
R2(config-if)#exit
R2(config)#interface loopback 4
R2(config-if)#ip address 192.168.24.1 255.255.255.0
R2(config-if)#exit


R3(config)#interface serial 5/1
R3(config-if)#ip address 23.1.1.2 255.0.0.0
R3(config-if)#no shutdown
R3(config-if)#exit
R3(config)#
R3(config)#interface loopback 1
R3(config-if)#ip address 192.168.31.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 2
R3(config-if)#ip address 192.168.32.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 3
R3(config-if)#ip address 192.168.33.1 255.255.255.0
R3(config-if)#exit
R3(config)#interface loopback 4
R3(config-if)#ip address 192.168.34.1 255.255.255.0
R3(config-if)#exit

R1(config)#router eigrp 100
R1(config-router)#network 12.0.0.0
R1(config-router)#network 192.168.11.0
R1(config-router)#network 192.168.12.0
R1(config-router)#network 192.168.13.0
R1(config-router)#network 192.168.14.0
R1(config-router)#no auto-summary
R1(config-router)#exit

R2(config)#router eigrp 100
R2(config-router)#network 192.168.21.0
R2(config-router)#network 192.168.22.0
R2(config-router)#network 192.168.23.0
R2(config-router)#network 192.168.24.0
R2(config-router)#network 12.0.0.0
R2(config-router)#network 23.0.0.0
R2(config-router)#exit

R3(config)#router eigrp 100
R3(config-router)#network 23.0.0.0
R3(config-router)#network 192.168.31.0
R3(config-router)#network 192.168.32.0
R3(config-router)#network 192.168.33.0
R3(config-router)#network 192.168.34.0
R3(config-router)#no auto-summary
R3(config-router)#exit

R2(config)#do show ip route eigrp
D    192.168.12.0/24 [90/2297856] via 12.1.1.1, 00:00:33, Serial5/0
D    192.168.13.0/24 [90/2297856] via 12.1.1.1, 00:00:33, Serial5/0
D    192.168.14.0/24 [90/2297856] via 12.1.1.1, 00:00:33, Serial5/0
D    192.168.31.0/24 [90/2297856] via 23.1.1.2, 00:00:24, Serial5/1
D    192.168.11.0/24 [90/2297856] via 12.1.1.1, 00:00:33, Serial5/0
D    192.168.34.0/24 [90/2297856] via 23.1.1.2, 00:00:24, Serial5/1
D    192.168.32.0/24 [90/2297856] via 23.1.1.2, 00:00:24, Serial5/1
D    192.168.33.0/24 [90/2297856] via 23.1.1.2, 00:00:24, Serial5/1


R2(config)#ip prefix-list INTERNET seq 10 deny 192.168.31.0/24
R2(config)#ip prefix-list INTERNET seq 15 deny 192.168.32.0/24
R2(config)#ip prefix-list INTERNET seq 30 permit 0.0.0.0/0 le 32


R2#show ip prefix-list
ip prefix-list INTERNET: 3 entries
   seq 10 deny 192.168.31.0/24
   seq 15 deny 192.168.32.0/24
   seq 30 permit 0.0.0.0/0 le 32


R2(config)#router eigrp 100
R2(config-router)#distribute-list prefix INTERNET in serial 5/1
*Aug 13 14:41:48.487: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 23.1.1.2 (Serial5/1) is resync: route configuration changed
R2(config-router)#end

R2#clear ip route *
R2#show ip route eigrp 100
D    192.168.12.0/24 [90/2297856] via 12.1.1.1, 00:00:19, Serial5/0
D    192.168.13.0/24 [90/2297856] via 12.1.1.1, 00:00:19, Serial5/0
D    192.168.14.0/24 [90/2297856] via 12.1.1.1, 00:00:19, Serial5/0
D    192.168.11.0/24 [90/2297856] via 12.1.1.1, 00:00:19, Serial5/0
D    192.168.34.0/24 [90/2297856] via 23.1.1.2, 00:00:19, Serial5/1
D    192.168.33.0/24 [90/2297856] via 23.1.1.2, 00:00:19, Serial5/1

R2(config)#ip prefix-list INTERNET seq 20 deny 192.168.11.0/24
R2(config)#end

R2(config)#router eigrp 100
R2(config-router)#distribute-list prefix INTERNET in serial 5/0
R2(config-router)#exit

R2#show ip prefix-list
ip prefix-list INTERNET: 4 entries
   seq 10 deny 192.168.31.0/24
   seq 15 deny 192.168.32.0/24
   seq 20 deny 192.168.11.0/24
   seq 30 permit 0.0.0.0/0 le 32

R2#show ip route eigrp 100
D    192.168.12.0/24 [90/2297856] via 12.1.1.1, 00:00:41, Serial5/0
D    192.168.13.0/24 [90/2297856] via 12.1.1.1, 00:00:41, Serial5/0
D    192.168.14.0/24 [90/2297856] via 12.1.1.1, 00:00:41, Serial5/0
D    192.168.34.0/24 [90/2297856] via 23.1.1.2, 00:00:41, Serial5/1
D    192.168.33.0/24 [90/2297856] via 23.1.1.2, 00:00:41, Serial5/1


(If you like this blog, please visit our YouTube channel https://www.youtube.com/@internetworkss)





No comments:

What is IP prefix-list? How to configure IP prefix-list?

  IP Prefix List An IP prefix list is a network filtering tool used primarily in routing protocols to control which routes are accepted o...