ADC CLI Commands

ns-pbr

The following operations can be performed on “ns-pbr”:

stat enable add set disable rm unset show

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.

Synopsis

stat ns pbr [] \[-detail] \[-fullValues] \[-ntimes <positive\_integer>] \[-logFile <input\_filename>] \[-clearstats \( basic | full )]

Arguments

name Name of the PBR whose statistics you want the Citrix ADC to display.

detail Specifies detailed output (including more statistics). The output can be quite voluminous. Without this argument, the output will show only a summary.

fullValues Specifies that numbers and strings should be displayed in their full form. Without this option, long strings are shortened and large numbers are abbreviated

ntimes The number of times, in intervals of seven seconds, the statistics should be displayed. Default value: 1 Minimum value: 0

logFile The name of the log file to be used as input.

clearstats Clear the statsistics / counters

Possible values: basic, full

Output

count devno stateflag

Counters

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

PBR Null Drop (PBRNullDrop) Total packets that are dropped due to null nexthop

Hits for this PBR (PBRHits) Number of times the pbr was hit

Example

stat pbr

enable ns pbr

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

Synopsis

enable ns pbr ...

Arguments

name Name of PBR that you want to enable.

Example

enable ns pbr foo

add ns pbr

Adds a policy based route (PBR) to the Citrix ADC. 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 Citrix ADC to route outgoing packets from a specific IP address or range to a particular next hop router.

Note: The Citrix ADC process PBRs before processing the RNAT rules.

Synopsis

add ns pbr \[-td <positive\_integer>] \[-srcIP \[] ] \[-srcPort \[] ] \[-destIP \[] ] \[-destPort \[] ] \(\(-nextHop ) | \(-ipTunnel \[-vxlanVlanMap ])) \[-srcMac <mac\_addr> \[-srcMacMask ]] \[-protocol | -protocolNumber <positive\_integer>] \[-vlan <positive\_integer> | -vxlan <positive\_integer>] \[-interface <interface\_name>] \[-priority <positive\_integer>] \[-msr \( ENABLED | DISABLED ) \[-monitor ]] \[-state \( ENABLED | DISABLED )] \[-ownerGroup ]

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. Cannot 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 Citrix ADC sends the packet to the designated next-hop router.
  • DENY - The Citrix ADC 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. For example: 10.102.29.30-10.102.29.189.

operator Either the equals (=) or does not equal (!=) logical operator.

Possible values: =, !=, EQ, NEQ

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. 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. For example: 40-90.

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

operator Either the equals (=) or does not equal (!=) logical operator.

Possible values: =, !=, EQ, NEQ

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. For example: 40-90.

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

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. For example: 10.102.29.30-10.102.29.189.

operator Either the equals (=) or does not equal (!=) logical operator.

Possible values: =, !=, EQ, NEQ

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. 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. For example: 40-90.

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

operator Either the equals (=) or does not equal (!=) logical operator.

Possible values: =, !=, EQ, NEQ

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. For example: 40-90.

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

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 Citrix ADC. Otherwise, the Citrix ADC throws an error when you attempt to create the PBR. The next hop can be null to represent null routes

nextHopVal The Next Hop IP address or gateway name.

ipTunnel The Tunnel name.

ipTunnelName The iptunnel name where packets need to be forwarded upon.

vxlanVlanMap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel

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

srcMacMask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value “000000111111”. Default value: “000000000000”

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, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, ICMPV6, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite

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 Citrix ADC 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 Citrix ADC 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 Citrix ADC 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

monitor The name of the monitor.(Can be only of type ping or ARP )

state Enable or disable the PBR. After you apply the PBRs, the Citrix ADC compares outgoing packets to the enabled PBRs.

Possible values: ENABLED, DISABLED Default value: ENABLED

ownerGroup The owner node group in a Cluster for this pbr rule. If ownernode is not specified then the pbr rule is treated as Striped pbr rule. Default value: DEFAULT_NG

Example

add ns pbr a allow -srcip 10.102.37.252 -destip 10.10.10.2 -nexthop 11.11.11.2 add ns pbr pt ALLOW -srcIP = 20.1.4.1 -destIP = 20.1.4.3 -ipTunnel t206 -vlanVxlanMap p3

set ns pbr

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

Synopsis

set ns pbr \[-action \( ALLOW | DENY )] \[-srcIP \[] ] \[-srcPort \[] ] \[-destIP \[] ] \[-destPort \[] ] \(\(-nextHop ) | \(-ipTunnel \[-vxlanVlanMap ])) \[-srcMac <mac\_addr> \[-srcMacMask ]] \[-protocol | -protocolNumber <positive\_integer>] \[-vlan <positive\_integer> | -vxlan <positive\_integer>] \[-interface <interface\_name>] \[-priority <positive\_integer>] \[-msr \( ENABLED | DISABLED ) \[-monitor ]]

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 Citrix ADC sends the packet to the designated next-hop router.
  • DENY - The Citrix ADC 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. For example: 10.102.29.30-10.102.29.189.

operator Either the equals (=) or does not equal (!=) logical operator.

Possible values: =, !=, EQ, NEQ

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. 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. For example: 40-90.

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

operator Either the equals (=) or does not equal (!=) logical operator.

Possible values: =, !=, EQ, NEQ

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. For example: 40-90.

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

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. For example: 10.102.29.30-10.102.29.189.

operator Either the equals (=) or does not equal (!=) logical operator.

Possible values: =, !=, EQ, NEQ

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. 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. For example: 40-90.

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

operator Either the equals (=) or does not equal (!=) logical operator.

Possible values: =, !=, EQ, NEQ

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. For example: 40-90.

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

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 Citrix ADC. Otherwise, the Citrix ADC throws an error when you attempt to create the PBR. The next hop can be null to represent null routes

nextHopVal The Next Hop IP address or gateway name.

ipTunnel The Tunnel name.

ipTunnelName The iptunnel name where packets need to be forwarded upon.

vxlanVlanMap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel

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

srcMacMask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value “000000111111”. Default value: “000000000000”

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, GGP, IPoverIP, ST, CBT, BBN-RCC-M, NVP-II, PUP, EMCON, XNET, CHAOS, MUX, DCN-MEAS, HMP, PRM, XNS-IDP, TRUNK-1, TRUNK-2, LEAF-1, LEAF-2, IRTP, ISO-TP4, NETBLT, MFE-NSP, MERIT-INP, SEP, 3PC, IDPR, XTP, DDP, IDPR-CMTP, TP++, IL, IPv6, SDRP, IPv6-Route, IPv6-Frag, IDRP, GRE, MHRP, BNA, ESP, AH, I-NLSP, SWIPE, NARP, MOBILE, TLSP, SKIP, ICMPV6, IPv6-NoNx, IPv6-Opts, Any-Host-Internal-Protocol, CFTP, Any-Local-Network, SAT-EXPAK, KRYPTOLAN, RVD, IPPC, Any-Distributed-File-System, TFTP, VISA, IPCV, CPNX, CPHB, WSN, PVP, BR-SAT-MO, SUN-ND, WB-MON, WB-EXPAK, ISO-IP, VMTP, SECURE-VM, VINES, TTP, NSFNET-IG, DGP, TCF, OSPFIGP, Sprite-RP, LARP, MTP, AX.25, IPIP, MICP, SCC-SP, ETHERIP, Any-Private-Encryption-Scheme, GMTP, IFMP, PNNI, PIM, ARIS, SCPS, QNX, A/N, IPComp, SNP, Compaq-Pe, IPX-in-IP, VRRP, PGM, Any-0-Hop-Protocol, ENCAP, DDX, IATP, STP, SRP, UTI, SMP, SM, PTP, FIRE, CRTP, CRUDP, SSCOPMCE, IPLT, SPS, PIPE, SCTP, FC, RSVP-E2E-IGNORE, Mobility-Header, UDPLite

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 Citrix ADC 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 Citrix ADC 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 Citrix ADC 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

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

Example

set ns pbr a -srcPort 50

disable ns pbr

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

Synopsis

disable ns pbr ...

Arguments

name Name of PBR that you want to disable.

Example

disable ns pbr foo

rm ns pbr

Removes a PBR from the Citrix ADC. To commit this operation, you must apply the PBRs.

Synopsis

rm ns pbr ...

Arguments

name Name of the PBR that you want to remove.

Example

rm ns pbr a

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.

Synopsis

unset ns pbr [-srcIP] [-srcPort] [-destIP] [-destPort] [-nextHop] [-ipTunnel] [-vxlanVlanMap] [-srcMac] [-srcMacMask] [-protocol] [-vlan] [-vxlan] [-interface] [-msr] [-monitor]

Example

unset ns pbr rule1 -srcPort

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.

Synopsis

show ns pbr [] [-detail]

Arguments

name Name of the PBR whose details you want the Citrix ADC to display.

detail To get a detailed view.

Output

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

Available settings function as follows:

  • ALLOW - The Citrix ADC sends the packet to the designated next-hop router.
  • DENY - The Citrix ADC applies the routing table for normal destination-based routing.

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

srcMacMask Used to define range of Source MAC address. It takes string of 0 and 1, 0s are for exact match and 1s for wildcard. For matching first 3 bytes of MAC address, srcMacMask value “000000111111”.

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. For example: 40-90.

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

operator Either the equals (=) or does not equal (!=) logical operator.

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. For example: 40-90.

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

operator Either the equals (=) or does not equal (!=) logical operator.

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. For example: 10.102.29.30-10.102.29.189.

operator Either the equals (=) or does not equal (!=) logical operator.

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. For example: 10.102.29.30-10.102.29.189.

operator Either the equals (=) or does not equal (!=) logical operator.

vlan ID of the VLAN. The Citrix ADC 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 Citrix ADC 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 Enable or disable the PBR. After you apply the PBRs, the Citrix ADC compares outgoing packets to the enabled PBRs.

interface ID of an interface. The Citrix ADC 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.

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.

vxlanVlanMap The vlan to vxlan mapping to be applied for incoming packets over this pbr tunnel

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

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

state If this route is UP/DOWN.

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.

ownerGroup The owner node group in a Cluster for this pbr rule. If ownernode is not specified then the pbr rule is treated as Striped pbr rule.

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: srcMacMask: Protocol: Vlan: Interface: Active Status: ENABLED Applied Status: NOTAPPLIED Priority: 10 NextHop: 11.11.11.2

ns-pbr