PBR - set interface command
When configuring Policy Based Routing (PBR) one can use the set interface
command to set the exit interface for IPv4/IPv6 packets that match particular criteria. However, when such a command is used on an Ethernet interface, you may get the following warning:
R1(config-route-map)#set interface gigabitethernet 0/1 %Warning:Use P2P interface for routemap setinterface clause R1(config-route-map)#
By issuing such a command route-map, you are telling the device what exit interface to use for PBR. However, if the exit interface belongs to a multi-access technology, like Ethernet, there may be multiple possible next hops on that network segment. This is what this particular error message is hinting at. In a P2P technology, such as a serial link, there is only one possible recipient on the other end, and this is why the designation of the exit interface is enough for the purposes of PBR.
Now, the error message is simply a warning, which means the command has been accepted. Any packets that match will be sent out of this interface, but they may fail to reach a next hop. To resolve the issue, one can replace the set interface
command with a set ip next-hop
command, indicating the next hop IP.