####################### Route and Route6 Policy ####################### IPv4 route and IPv6 route policies are defined in this section. These route policies can then be associated to interfaces. ********* Rule-Sets ********* A rule-set is a named collection of rules that can be applied to an interface. Each rule is numbered, has an action to apply if the rule is matched, and the ability to specify the criteria to match. Data packets go through the rules from 1 - 999999, at the first match the action of the rule will be executed. .. cfgcmd:: set policy route description .. cfgcmd:: set policy route6 description Provide a rule-set description. .. cfgcmd:: set policy route default-log .. cfgcmd:: set policy route6 default-log Option to log packets hitting default-action. .. cfgcmd:: set policy route rule description .. cfgcmd:: set policy route6 rule description Provide a description for each rule. .. cfgcmd:: set policy route rule log .. cfgcmd:: set policy route6 rule log Option to enable or disable log matching rule. Matching criteria ================= There are a lot of matching criteria options available, both for ``policy route`` and ``policy route6``. These options are listed in this section. .. cfgcmd:: set policy route rule connection-mark <1-2147483647> .. cfgcmd:: set policy route6 rule connection-mark <1-2147483647> Set match criteria based on connection mark. .. cfgcmd:: set policy route rule source address .. cfgcmd:: set policy route rule destination address .. cfgcmd:: set policy route6 rule source address .. cfgcmd:: set policy route6 rule destination address Set match criteria based on source or destination ipv4|ipv6 address, where could be: For ipv4: * : IP address to match. * : Subnet to match. * -: IP range to match. * !: Match everything except the specified address. * !: Match everything except the specified subnet. * !-: Match everything except the specified range. And for ipv6: * : IPv6 address to match. * : IPv6 prefix to match. * -: IPv6 range to match. * !: Match everything except the specified address. * !: Match everything except the specified prefix. * !-: Match everything except the specified range. .. cfgcmd:: set policy route rule source group .. cfgcmd:: set policy route rule destination group .. cfgcmd:: set policy route6 rule source group .. cfgcmd:: set policy route6 rule destination group Set match criteria based on source or destination groups, where would be the group name/identifier. Prepend character '!' for inverted matching criteria. .. cfgcmd:: set policy route rule destination port .. cfgcmd:: set policy route6 rule destination port Set match criteria based on destination port, where could be: * : Named port (any name in /etc/services, e.g., http). * <1-65535>: Numbered port. * -: Numbered port range (e.g., 1001-1005). Multiple destination ports can be specified as a comma-separated list. The whole list can also be "negated" using '!'. For example: '!22,telnet,http,123,1001-1005' .. cfgcmd:: set policy route rule disable .. cfgcmd:: set policy route6 rule disable Option to disable rule. .. cfgcmd:: set policy route rule dscp .. cfgcmd:: set policy route6 rule dscp .. cfgcmd:: set policy route rule dscp-exclude .. cfgcmd:: set policy route6 rule dscp-exclude Match based on dscp value criteria. Multiple values from 0 to 63 and ranges are supported. .. cfgcmd:: set policy route rule fragment .. cfgcmd:: set policy route6 rule fragment Set IP fragment match, where: * match-frag: Second and further fragments of fragmented packets. * match-non-frag: Head fragments or unfragmented packets. .. cfgcmd:: set policy route rule icmp .. cfgcmd:: set policy route6 rule icmpv6 Match based on icmp|icmpv6 code and type. .. cfgcmd:: set policy route rule icmp type-name .. cfgcmd:: set policy route6 rule icmpv6 type-name Match based on icmp|icmpv6 type-name criteria. Use tab for information about what type-name criteria are supported. .. cfgcmd:: set policy route rule ipsec .. cfgcmd:: set policy route6 rule ipsec Set IPSec inbound match criterias, where: * match-ipsec: match inbound IPsec packets. * match-none: match inbound non-IPsec packets. .. cfgcmd:: set policy route rule limit burst <0-4294967295> .. cfgcmd:: set policy route6 rule limit burst <0-4294967295> Set maximum number of packets to alow in excess of rate. .. cfgcmd:: set policy route rule limit rate .. cfgcmd:: set policy route6 rule limit rate Set maximum average matching rate. Format for rate: integer/time_unit, where time_unit could be any one of second, minute, hour or day.For example 1/second implies rule to be matched at an average of once per second. .. cfgcmd:: set policy route rule protocol .. cfgcmd:: set policy route6 rule protocol Match a protocol criteria. A protocol number or a name which is defined in: ``/etc/protocols``. Special names are ``all`` for all protocols and ``tcp_udp`` for tcp and udp based packets. The ``!`` negates the selected protocol. .. cfgcmd:: set policy route rule packet-length .. cfgcmd:: set policy route6 rule packet-length .. cfgcmd:: set policy route rule packet-length-exclude .. cfgcmd:: set policy route6 rule packet-length-exclude Match based on packet length criteria. Multiple values from 1 to 65535 and ranges are supported. .. cfgcmd:: set policy route rule packet-type [broadcast | host | multicast | other] .. cfgcmd:: set policy route6 rule packet-type [broadcast | host | multicast | other] Match based on packet type criteria. .. cfgcmd:: set policy route rule recent count <1-255> .. cfgcmd:: set policy route6 rule recent count <1-255> .. cfgcmd:: set policy route rule recent time <1-4294967295> .. cfgcmd:: set policy route6 rule recent time <1-4294967295> Set parameters for matching recently seen sources. This match could be used by seeting count (source address seen more than <1-255> times) and/or time (source address seen in the last <0-4294967295> seconds). .. cfgcmd:: set policy route rule state .. cfgcmd:: set policy route6 rule state Set match criteria based on session state. .. cfgcmd:: set policy route rule tcp flags .. cfgcmd:: set policy route6 rule tcp flags Set match criteria based on tcp flags. Allowed values for TCP flags: SYN ACK FIN RST URG PSH ALL. When specifying more than one flag, flags should be comma-separated. For example : value of 'SYN,!ACK,!FIN,!RST' will only match packets with the SYN flag set, and the ACK, FIN and RST flags unset. .. cfgcmd:: set policy route rule time monthdays .. cfgcmd:: set policy route6 rule time monthdays .. cfgcmd:: set policy route rule time startdate .. cfgcmd:: set policy route6 rule time startdate .. cfgcmd:: set policy route rule time starttime .. cfgcmd:: set policy route6 rule time starttime .. cfgcmd:: set policy route rule time stopdate .. cfgcmd:: set policy route6 rule time stopdate .. cfgcmd:: set policy route rule time stoptime .. cfgcmd:: set policy route6 rule time stoptime .. cfgcmd:: set policy route rule time weekdays .. cfgcmd:: set policy route6 rule time weekdays .. cfgcmd:: set policy route rule time utc .. cfgcmd:: set policy route6 rule time utc Time to match the defined rule. .. cfgcmd:: set policy route rule ttl <0-255> Match time to live parameter, where 'eq' stands for 'equal'; 'gt' stands for 'greater than', and 'lt' stands for 'less than'. .. cfgcmd:: set policy route6 rule hop-limit <0-255> Match hop-limit parameter, where 'eq' stands for 'equal'; 'gt' stands for 'greater than', and 'lt' stands for 'less than'. Actions ======= When mathcing all patterns defined in a rule, then different actions can be made. This includes droping the packet, modifying certain data, or setting a different routing table. .. cfgcmd:: set policy route rule action drop .. cfgcmd:: set policy route6 rule action drop Set rule action to drop. .. cfgcmd:: set policy route rule set connection-mark <1-2147483647> .. cfgcmd:: set policy route6 rule set connection-mark <1-2147483647> Set a specific connection mark. .. cfgcmd:: set policy route rule set dscp <0-63> .. cfgcmd:: set policy route6 rule set dscp <0-63> Set packet modifications: Packet Differentiated Services Codepoint (DSCP) .. cfgcmd:: set policy route rule set mark <1-2147483647> .. cfgcmd:: set policy route6 rule set mark <1-2147483647> Set a specific packet mark. .. cfgcmd:: set policy route rule set table
.. cfgcmd:: set policy route6 rule set table
Set the routing table to forward packet with. .. cfgcmd:: set policy route rule set tcp-mss <500-1460> .. cfgcmd:: set policy route6 rule set tcp-mss <500-1460> Set packet modifications: Explicitly set TCP Maximum segment size value.