The route
command's -proto
* flags set matching the RTF_PROTO
* flag bits in the appropriate routing table entry's rt_flags
field (i.e. they have no other value parameter -- they each represent individual bits).
They do not make the route "protocol specific", but rather are generic flag bits that can be used in a protocol specific way by whatever lower layer protocol the route uses.
In the BSD networking code protocol specific parts of the code will often define more meaningful names to map to the same flag bits. For example in the ARP layer the RTF_ANNOUNCE
flag is the same bit in the rt_flags
field as the RTF_PROTO2
bit.
In the case of ARP the flag is set in the routing table by the arp
command (if the word pub
is given on the command line when creating an ARP entry manually), not by the route
command. However the netstat -r
command may show the flag on the resulting routing table entry as 2
, indicating RTF_PROTO2
(as would route -v show
).
If you want to force all packets for a specific transport protocol, e.g. UDP or TCP, then you will have to investigate different mechanisms than the routing table -- for example some firewalls can forward packets to specified interfaces based on protocol value given in the IP header.