Skip to content

ns pbr

The following operations can be performed on "ns pbr":

add | rm | set | unset | enable | disable | stat | show

add ns pbr

Adds a policy based route (PBR) to the NetScaler appliance. To commit this operation, you must apply the PBRs.A PBR specifies criteria for selecting outgoing IPv4 packets and, typically, a next hop to which to send the selected packets. For example, you can configure the NetScaler appliance to route outgoing packets from a specific IP address or range to a particular next hop router.Note: The NetScaler appliance process PBRs before processing the RNAT rules.

Synopsys

add ns pbr <name> <action> [-td <positive_integer>] [-srcIP [<operator>] <srcIPVal>] [-srcPort [<operator>] <srcPortVal>] [-destIP [<operator>] <destIPVal>] [-destPort [<operator>] <destPortVal>] ((-nextHop <nextHopVal>) | (-ipTunnel <ipTunnelName>)) [-srcMac <mac_addr>] [-protocol <protocol> | -protocolNumber <positive_integer>] [-vlan <positive_integer> | -vxlan <positive_integer>] [-interface <interface_name>] [-priority <positive_integer>] [-msr ( ENABLED | DISABLED ) [-monitor <string>]] [-state ( ENABLED | DISABLED )]

Arguments

name

Name for the PBR. Must begin with an ASCII alphabetic or underscore \(_\) character, and must contain only ASCII alphanumeric, underscore, hash \(\#\), period \(.\), space, colon \(:\), at \(@\), equals \(=\), and hyphen \(-\) characters. Can be changed after the PBR is created.

action

Action to perform on the outgoing IPv4 packets that match the PBR.

Available settings function as follows:

  • ALLOW - The NetScaler appliance sends the packet to the designated next-hop router.

  • DENY - The NetScaler appliance applies the routing table for normal destination-based routing.

Possible values: ALLOW, DENY

td

Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0.

Minimum value: 0

Maximum value: 4094

srcIP

IP address or range of IP addresses to match against the source IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [10.102.29.30-10.102.29.189].

srcPort

Port number or range of port numbers to match against the source port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [40-90].

Note: The destination port can be specified only for TCP and UDP protocols.

destIP

IP address or range of IP addresses to match against the destination IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [10.102.29.30-10.102.29.189].

destPort

Port number or range of port numbers to match against the destination port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [40-90].

Note: The destination port can be specified only for TCP and UDP protocols.

nextHop

IP address of the next hop router or the name of the link load balancing virtual server to which to send matching packets if action is set to ALLOW.

If you specify a link load balancing (LLB) virtual server, which can provide a backup if a next hop link fails, first make sure that the next hops bound to the LLB virtual server are actually next hops that are directly connected to the NetScaler appliance. Otherwise, the NetScaler throws an error when you attempt to create the PBR.

ipTunnel

The Tunnel name.

srcMac

MAC address to match against the source MAC address of an outgoing IPv4 packet.

protocol

Protocol, identified by protocol name, to match against the protocol of an outgoing IPv4 packet.

Possible values: ICMP, IGMP, TCP, EGP, IGP, ARGUS, UDP, RDP, RSVP, EIGRP, L2TP, ISIS

protocolNumber

Protocol, identified by protocol number, to match against the protocol of an outgoing IPv4 packet.

Minimum value: 1

Maximum value: 255

vlan

ID of the VLAN. The NetScaler appliance compares the PBR only to the outgoing packets on the specified VLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VLANs.

Minimum value: 1

Maximum value: 4094

vxlan

ID of the VXLAN. The NetScaler appliance compares the PBR only to the outgoing packets on the specified VXLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VXLANs.

Minimum value: 1

Maximum value: 16777215

interface

ID of an interface. The NetScaler appliance compares the PBR only to the outgoing packets on the specified interface. If you do not specify any value, the appliance compares the PBR to the outgoing packets on all interfaces.

priority

Priority of the PBR, which determines the order in which it is evaluated relative to the other PBRs. If you do not specify priorities while creating PBRs, the PBRs are evaluated in the order in which they are created.

Minimum value: 1

Maximum value: 81920

msr

Monitor the route specified byte Next Hop parameter. This parameter is not applicable if you specify a link load balancing (LLB) virtual server name with the Next Hop parameter.

Possible values: ENABLED, DISABLED

Default value: DISABLED

state

Enable or disable the PBR. After you apply the PBRs, the NetScaler appliance compares outgoing packets to the enabled PBRs.

Possible values: ENABLED, DISABLED

Default value: XACLENABLED

Example

add ns pbr a allow -srcip 10.102.37.252 -destip 10.10.10.2 -nexthop 11.11.11.2

rm ns pbr

Removes a PBR from the NetScaler appliance. To commit this operation, you must apply the PBRs.

Synopsys

rm ns pbr <name> ...

Arguments

name

Name of the PBR that you want to remove.

Example

rm ns pbr a

set ns pbr

Modifies the specified parameters of a PBR. To commit this operation, you must apply the PBRs.

Synopsys

set ns pbr <name> [-action ( ALLOW | DENY )] [-srcIP [<operator>] <srcIPVal>] [-srcPort [<operator>] <srcPortVal>] [-destIP [<operator>] <destIPVal>] [-destPort [<operator>] <destPortVal>] ((-nextHop <nextHopVal>) | (-ipTunnel <ipTunnelName>)) [-srcMac <mac_addr>] [-protocol <protocol> | -protocolNumber <positive_integer>] [-vlan <positive_integer> | -vxlan <positive_integer>] [-interface <interface_name>] [-priority <positive_integer>] [-msr ( ENABLED | DISABLED ) [-monitor <string>]]

Arguments

name

Name of the PBR whose parameters you want to modify.

action

Action to perform on the outgoing IPv4 packets that match the PBR.

Available settings function as follows:

  • ALLOW - The NetScaler appliance sends the packet to the designated next-hop router.

  • DENY - The NetScaler appliance applies the routing table for normal destination-based routing.

Possible values: ALLOW, DENY

srcIP

IP address or range of IP addresses to match against the source IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [10.102.29.30-10.102.29.189].

srcPort

Port number or range of port numbers to match against the source port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [40-90].

Note: The destination port can be specified only for TCP and UDP protocols.

destIP

IP address or range of IP addresses to match against the destination IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [10.102.29.30-10.102.29.189].

destPort

Port number or range of port numbers to match against the destination port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [40-90].

Note: The destination port can be specified only for TCP and UDP protocols.

nextHop

IP address of the next hop router or the name of the link load balancing virtual server to which to send matching packets if action is set to ALLOW.

If you specify a link load balancing (LLB) virtual server, which can provide a backup if a next hop link fails, first make sure that the next hops bound to the LLB virtual server are actually next hops that are directly connected to the NetScaler appliance. Otherwise, the NetScaler throws an error when you attempt to create the PBR.

ipTunnel

The Tunnel name.

srcMac

MAC address to match against the source MAC address of an outgoing IPv4 packet.

protocol

Protocol, identified by protocol name, to match against the protocol of an outgoing IPv4 packet.

Possible values: ICMP, IGMP, TCP, EGP, IGP, ARGUS, UDP, RDP, RSVP, EIGRP, L2TP, ISIS

protocolNumber

Protocol, identified by protocol number, to match against the protocol of an outgoing IPv4 packet.

Minimum value: 1

Maximum value: 255

vlan

ID of the VLAN. The NetScaler appliance compares the PBR only to the outgoing packets on the specified VLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VLANs.

Minimum value: 1

Maximum value: 4094

vxlan

ID of the VXLAN. The NetScaler appliance compares the PBR only to the outgoing packets on the specified VXLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VXLANs.

Minimum value: 1

Maximum value: 16777215

interface

ID of an interface. The NetScaler appliance compares the PBR only to the outgoing packets on the specified interface. If you do not specify any value, the appliance compares the PBR to the outgoing packets on all interfaces.

priority

Priority of the PBR, which determines the order in which it is evaluated relative to the other PBRs. If you do not specify priorities while creating PBRs, the PBRs are evaluated in the order in which they are created.

Minimum value: 1

Maximum value: 81920

msr

Monitor the route specified byte Next Hop parameter. This parameter is not applicable if you specify a link load balancing (LLB) virtual server name with the Next Hop parameter.

Possible values: ENABLED, DISABLED

Default value: DISABLED

Example

set ns pbr a -srcPort 50

unset ns pbr

Resets the attributes of the specified PBR. Attributes for which a default value is available revert to their default values. Refer to the set ns pbr command for descriptions of the parameters..Refer to the set ns pbr command for meanings of the arguments.

Synopsys

unset ns pbr <name> [-srcIP] [-srcPort] [-destIP] [-destPort] [-nextHop] [-ipTunnel] [-srcMac] [-protocol] [-vlan] [-vxlan] [-interface] [-msr] [-monitor]

Example

unset ns pbr rule1 -srcPort

enable ns pbr

Enables a PBR. To commit this operation, you must apply the PBRs. After you apply the PBRs, the NetScaler appliance compares outgoing packets to the enabled PBRs.

Synopsys

enable ns pbr <name> ...

Arguments

name

Name of PBR that you want to enable.

Example

enable ns pbr foo

disable ns pbr

Disables a PBR. To commit this operation, you must apply the PBRs. After you apply the PBRs, the NetScaler appliance does not compare outgoing packets against the disabled PBRs

Synopsys

disable ns pbr <name> ...

Arguments

name

Name of PBR that you want to disable.

Example

disable ns pbr foo

stat ns pbr

Displays statistics related to the PBRs. To display statistics of all the PBRs, run the command without any parameters. To display statistics of a particular PBR, specify the name of the PBR.

Synopsys

stat ns pbr [<name>] [-detail] [-fullValues] [-ntimes <positive_integer>] [-logFile <input_filename>] [-clearstats ( basic | full )]

Arguments

name

Name of the PBR whose statistics you want the NetScaler appliance to display.

clearstats

Clear the statsistics / counters

Possible values: basic, full

Outputs

count

devno

stateflag

Outputs

Allow PBR hits (PBRAllow)

Total packets that matched the PBR (Policy-Based Routes) with action ALLOW

Deny PBR hits (PBRDeny)

Total packets that matched the PBR with action DENY

PBR hits (PBRTotHits)

Total packets that matched one of the configured PBR

PBR misses (PBRMiss)

Total packets that did not match any PBR

Hits for this PBR (PBRHits)

Number of times the pbr was hit

Example

stat pbr

show ns pbr

Displays settings related to the PBRs. To display settings of all the PBRs, run the command without any parameters. To display settings of a particular PBR, specify the name of the PBR.

Synopsys

show ns pbr [<name>] [-detail]

Arguments

name

Name of the PBR whose details you want the NetScaler appliance to display.

detail

To get a detailed view.

summary

fullValues

format

level

Outputs

action

Action to perform on the outgoing IPv4 packets that match the PBR.

Available settings function as follows:

  • ALLOW - The NetScaler appliance sends the packet to the designated next-hop router.

  • DENY - The NetScaler appliance applies the routing table for normal destination-based routing.

srcMac

MAC address to match against the source MAC address of an outgoing IPv4 packet.

protocol

The protocol number in IP header or name.

protocolNumber

The protocol number in IP header or name.

srcPortVal

Port number or range of port numbers to match against the source port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [40-90].

Note: The destination port can be specified only for TCP and UDP protocols.

td

Integer value that uniquely identifies the traffic domain in which you want to configure the entity. If you do not specify an ID, the entity becomes part of the default traffic domain, which has an ID of 0.

destPortVal

Port number or range of port numbers to match against the destination port number of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [40-90].

Note: The destination port can be specified only for TCP and UDP protocols.

srcIPVal

IP address or range of IP addresses to match against the source IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [10.102.29.30-10.102.29.189].

destIPVal

IP address or range of IP addresses to match against the destination IP address of an outgoing IPv4 packet. In the command line interface, separate the range with a hyphen and enclose within brackets. For example: [10.102.29.30-10.102.29.189].

vlan

ID of the VLAN. The NetScaler appliance compares the PBR only to the outgoing packets on the specified VLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VLANs.

vxlan

ID of the VXLAN. The NetScaler appliance compares the PBR only to the outgoing packets on the specified VXLAN. If you do not specify any interface ID, the appliance compares the PBR to the outgoing packets on all VXLANs.

state

If this route is UP/DOWN.

interface

ID of an interface. The NetScaler appliance compares the PBR only to the outgoing packets on the specified interface. If you do not specify any value, the appliance compares the PBR to the outgoing packets on all interfaces.

hits

The hits of this PBR.

priority

Priority of the PBR, which determines the order in which it is evaluated relative to the other PBRs. If you do not specify priorities while creating PBRs, the PBRs are evaluated in the order in which they are created.

operator

Logical operator.

kernelstate

The commit status of the PBR.

nextHopVal

The Next Hop IP address or gateway name.

ipTunnelName

The iptunnel name where packets need to be forwarded upon.

msr

Whether Monitored Static Route(MSR) is enabled or disabled.

monitor

Name of the monitor, of type PING or ARP, configured on the NetScaler appliance to monitor the route specified by the Next Hop parameter. You must enable the MSR parameter before setting this parameter.

totalprobes

The total number of probes sent.

totalfailedprobes

The total number of failed probes.

failedprobes

Number of the current failed monitoring probes.

monStatCode

The code indicating the monitor response.

monStatParam1

First parameter for use with message code.

monStatParam2

Second parameter for use with message code.

monStatParam3

Third parameter for use with message code.

data

Internal data of this route.

devno

count

stateflag

Example

show ns pbr a Name: a Action: ALLOW Hits: 0 srcIP = 10.102.37.252 destIP = 10.10.10.2 srcMac: Protocol: Vlan: Interface: Active Status: ENABLED Applied Status: NOTAPPLIED Priority: 10 NextHop: 11.11.11.2

Was this article helpful?