Static routes
U
SER
G
UIDE
148
show ip route tag N
show ip route cache
SET MARK COMMAND
The command
set mark
allows to mark the packets, which is useful for the Policy Base Routing
operation described in the following paragraph. This command allows you to classify the traffic
based on any combination of the header fields that form the package and to apply a value to the
mark. Keep in mind that this marking is not performed on the packet sent in the network, but it is
applied on a descriptor inside the package itself.
The possible combinations are:
set mark VALUE protocol PROT from ADDRESS to ADDRESS out-interface INTF in-interface INTF
set mark VALUE protocol PROT from ADDRESS source-port PORT to ADDRESS dest-port PORT out-interface INTF in-interface INTF
where:
VALUE
is the numerical value of the mark
PROTOCOL
is the protocol type, that can be:
TCP
UDP
ICMP
GRE
OSPF
L2TPV3
any
ADDRESS
can be a network prefix (
10.10.10.0/24
) or the keyword
any
(that mean any
address) or the keyword
this
(that mean any address of the router itself)
PORT
is a numeric number that identify UDP or TCP ports, or a string that tells the service
(Telnet, SSH, SNMP,...) or the keyword
any
.
P
OLICY
B
ASE
R
OUTING
Unlike the classical routing, which allows you to make decisions based on the IP destination, the
Routing Policy allows you to select the routing based on the destination as well as on other
parameters such as the source IP address, the protocol type, the source or destination, the TOS or
any combination of the fields of the IP packet.
This mechanism is obtained combining properly the following commands:
set route
defines multiple routing tables. It always exists a default routing table (called
main table); the other ones are created by specifying the
table
option, which can have value
starting from
1
to
4
.
set policy-routing
establishes the criteria for consultation of the routing tables
set mark
is used to mark the packets.
Every routing criteria is described in a separate routing table. To be more clear, let's have a look to
some examples.