NULL0 is a mechanism used to drop packets in the Policy-Based Routing (PBR). If the NULL0 interface is specified within a stanza and the stanza also contains a “match ACL” statement, only traffic meeting the match criteria within the ACL is forwarded to the NULL0 interface. If the NULL0 interface is specified within a stanza that does not contain a “match” statement, the match criteria is implicitly “match any.”
In this example, the use of the NULL0 interface is only applicable to frames that meet the match criteria defined in the created ACL, or implicit "permit any" when no explicit match statement is listed for the stanza.
device(config)# ip access-list standard Jules device(conf-ipacl-std)# permit 192.168.0.0 255.255.255.0 device(conf-ipacl-std)# deny 192.168.1.1 255.255.255.0 device(config)# ip access-list standard Vincent device(conf-ipacl-std)# permit 192.168.2.2 255.255.255.0
device(config)# route-map pulp_fiction permit 10 device(config-routemap-pulp_fiction/permit/10)# match ip address acl Jules device(config-routemap-pulp_fiction/permit/10)# set ip vrf pulp_fiction next-hop 3.3.3.3 device(config-routemap-pulp_fiction/permit/10)# set ip interface NULL0
device(config)# route-map pulp_fiction permit 20 device(config-routemap-pulp_fiction/permit/20)# match ip address acl Vincent device(config-routemap-pulp_fiction/permit/20)# set ip vrf pulp_fiction next-hop 3.3.3.5
Based on the above configuration, when address 192.168.0.0 255.255.255.0 is received, it matches stanza 10: