You should issue the following commands on RouterB to ensure that the route to 192.168.5.0/24 will not be advertised to RouterA: RouterB(config)#access-list 10 deny 192.168.5.0 0.0.0.255 RouterB(config)#access-list 10 permit any RouterB(config)#router eigrp 20 RouterB(config-router)#distribute-list 10 out S0/0 The access-list 10 deny 192.168.5.0 0.0.0.255 command defines a standard IP access list named 10 with a default action of deny that will match the 192.168.5.0/24 network. The syntax for creating a standard IP access list is access-list access-list-number {}{deny | permit} {any | source [source-wildcard]}. The access-list-number can be a number from 1 through 99 or from 1300 through 1399. The permit keyword filters all IP addresses or prefixes that do not match the source IP address and the optional source-wildcard mask. The deny keyword filters only IP addresses or prefixes that match the source IP address and the optional source-wildcard mask. A wildcard mask, not a subnet mask, is required for IP access lists; a wildcard mask is basically a reverse subnet mask that indicates which bits are ignored when determining whether an address is affected by the access list. To calculate the appropriate wildcard mask, you should subtract the subnet mask from 255.255.255.255. For example, the 192.168.5.0 network has a 24-bit subnet mask, which is 255.255.255.0. Subtracting 255.255.255.0 from 255.255.255.255 yields a wildcard mask of 0.0.0.255. The access-list 10 permit any command adds an additional statement to access list 10; this statement permits any routes that have not been filtered by the access-list 10 deny 192.168.5.0 0.0.0.255 command. The any keyword can be used in place of a source IP address and source-wildcard mask to indicate that any IP address or prefix will satisfy the access list. Access lists also have an implicit deny any statement that is applied to any routes that have not been explicitly permitted or denied by previous access-list statements. Access lists are processed in sequential order, and the first match found dictates what action is taken. Once a match has been found, no further access-list statements are processed. The router eigrp 20 command places the router into router configuration mode for Enhanced Interior Gateway Routing Protocol (EIGRP) autonomous system (AS) 20. The distribute-list 10 out S0/0 command filters outbound route advertisements on interface S0/0 that match access list 10. The following commands will not prevent the route to 192.168.5.0/24 from being advertised to RouterA: RouterB(config)#access-list 10 deny 192.168.5.0 0.0.0.255 RouterB(config)#access-list 10 permit any RouterB(config)#router eigrp 20 RouterB(config-router)#distribute-list 10 in S0/0 The distribute list defined by the distribute-list 10 in S0/0 command filters inbound route advertisements on interface S0/0 that match access list 10; outbound route advertisements are not affected. Only routes advertised from RouterA to RouterB enter through the S0/0 interface. The route to network 192.168.5.0/24 is advertised from RouterC to RouterB through the S0/1 interface and is therefore unaffected by the distribute-list 10 in S0/0 command. Distribute lists are often used with two-way redistribution in order to prevent routing loops. The following commands will not prevent only the route to 192.168.5.0/24 from being advertised toRouterA: RouterB(config)#access-list 10 deny 192.168.5.0 255.255.255.0 RouterB(config)#access-list 10 permit any RouterB(config)#router eigrp 20 RouterB(config-router)#distribute-list 10 out S0/0 The standard IP access list defined by the access-list 10 deny 192.168.5.0 255.255.255.0 command specifies a subnet mask of 255.255.255.0 instead of a wildcard mask of 0.0.0.255.When the access list is applied by using the distribute-list 10 out S0/0 command, this wildcard mask filters all the networks in the AS; thus, the networks are not sent to RouterA. A wildcard mask, not a subnet mask, is required for IP access lists. To calculate the appropriate wildcard mask, subtract the subnet mask from 255.255.255.255. The following commands will not prevent only the route to 192.168.5.0/24 from being advertised to RouterA: RouterB(config)#access-list 10 deny 192.168.5.0 255.255.255.0 RouterB(config)#access-list 10 permit any RouterB(config)#router eigrp 20 RouterB(config-router)#distribute-list 10 in S0/0 The standard IP access list defined by the access-list 10 deny 192.168.5.0 255.255.255.0 command also incorrectly specifies the subnet mask of 255.255.255.0 as the wildcard mask.When the access list is applied by using the distribute-list 10 in S0/0 command on RouterB, the wildcard mask filters all the networks that RouterA advertises to RouterB but does not prevent routes from being advertised from RouterB to RouterA. Reference: https://www.cisco.com/c/en/us/support/docs/ip/interior-gateway-routing-protocol-igrp/9105-34.html https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_eigrp/configuration/xe-16-12/ire-xe-16-12-book/eigrp-route-map.html#GUID-FEA676E4-4D36-45E1-9CD4-21DF654941B3 CCNP Enterprise Advanced Routing ENARSI 300-410 Official Cert Guide, Chapter 12: Advanced BGP, Distribution List Filtering
You should issue the following commands on RouterB to ensure that the route to 192.168.5.0/24 will not be advertised to RouterA:
RouterB(config)#access-list 10 deny 192.168.5.0 0.0.0.255
RouterB(config)#access-list 10 permit any
RouterB(config)#router eigrp 20
RouterB(config-router)#distribute-list 10 out S0/0
The access-list 10 deny 192.168.5.0 0.0.0.255 command defines a standard IP access list named 10 with a default action of deny that will match the 192.168.5.0/24 network. The syntax for creating a standard IP access list is access-list access-list-number {}{deny | permit} {any | source [source-wildcard]}. The access-list-number can be a number from 1 through 99 or from 1300 through 1399. The permit keyword filters all IP addresses or prefixes that do not match the source IP address and the optional source-wildcard mask. The deny keyword filters only IP addresses or prefixes that match the source IP address and the optional source-wildcard mask. A wildcard mask, not a subnet mask, is required for IP access lists; a wildcard mask is basically a reverse subnet mask that indicates which bits are ignored when determining whether an address is affected by the access list. To calculate the appropriate wildcard mask, you should subtract the subnet mask from 255.255.255.255. For example, the 192.168.5.0 network has a 24-bit subnet mask, which is 255.255.255.0. Subtracting 255.255.255.0 from 255.255.255.255 yields a wildcard mask of 0.0.0.255.
The access-list 10 permit any command adds an additional statement to access list 10; this statement permits any routes that have not been filtered by the access-list 10 deny 192.168.5.0 0.0.0.255 command. The any keyword can be used in place of a source IP address and source-wildcard mask to indicate that any IP address or prefix will satisfy the access list. Access lists also have an implicit deny any statement that is applied to any routes that have not been explicitly permitted or denied by previous access-list statements. Access lists are processed in sequential order, and the first match found dictates what action is taken. Once a match has been found, no further access-list statements are processed.
The router eigrp 20 command places the router into router configuration mode for Enhanced Interior Gateway Routing Protocol (EIGRP) autonomous system (AS) 20. The distribute-list 10 out S0/0 command filters outbound route advertisements on interface S0/0 that match access list 10.
The following commands will not prevent the route to 192.168.5.0/24 from being advertised to RouterA:
RouterB(config)#access-list 10 deny 192.168.5.0 0.0.0.255
RouterB(config)#access-list 10 permit any
RouterB(config)#router eigrp 20
RouterB(config-router)#distribute-list 10 in S0/0
The distribute list defined by the distribute-list 10 in S0/0 command filters inbound route advertisements on interface S0/0 that match access list 10; outbound route advertisements are not affected. Only routes advertised from RouterA to RouterB enter through the S0/0 interface. The route to network 192.168.5.0/24 is advertised from RouterC to RouterB through the S0/1 interface and is therefore unaffected by the distribute-list 10 in S0/0 command. Distribute lists are often used with two-way redistribution in order to prevent routing loops.
The following commands will not prevent only the route to 192.168.5.0/24 from being advertised to
RouterA:
RouterB(config)#access-list 10 deny 192.168.5.0 255.255.255.0
RouterB(config)#access-list 10 permit any
RouterB(config)#router eigrp 20
RouterB(config-router)#distribute-list 10 out S0/0
The standard IP access list defined by the access-list 10 deny 192.168.5.0 255.255.255.0 command specifies a subnet mask of 255.255.255.0 instead of a wildcard mask of 0.0.0.255.
When the access list is applied by using the distribute-list 10 out S0/0 command, this wildcard mask filters all the networks in the AS; thus, the networks are not sent to RouterA. A wildcard mask, not a subnet mask, is required for IP access lists. To calculate the appropriate wildcard mask, subtract the subnet mask from 255.255.255.255.
The following commands will not prevent only the route to 192.168.5.0/24 from being advertised to RouterA:
RouterB(config)#access-list 10 deny 192.168.5.0 255.255.255.0
RouterB(config)#access-list 10 permit any
RouterB(config)#router eigrp 20
RouterB(config-router)#distribute-list 10 in S0/0
The standard IP access list defined by the access-list 10 deny 192.168.5.0 255.255.255.0 command also incorrectly specifies the subnet mask of 255.255.255.0 as the wildcard mask.
When the access list is applied by using the distribute-list 10 in S0/0 command on RouterB, the wildcard mask filters all the networks that RouterA advertises to RouterB but does not prevent routes from being advertised from RouterB to RouterA.
Reference: https://www.cisco.com/c/en/us/support/docs/ip/interior-gateway-routing-protocol-igrp/9105-34.html
https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/iproute_eigrp/configuration/xe-16-12/ire-xe-16-12-book/eigrp-route-map.html#GUID-FEA676E4-4D36-45E1-9CD4-21DF654941B3
CCNP Enterprise Advanced Routing ENARSI 300-410 Official Cert Guide, Chapter 12: Advanced BGP, Distribution List Filtering