Consider a scenario in which two PBRs, PBR1 and PBR2, are configured on NetScaler appliance NS1. PBR1 routes all the outgoing packets, with source IP address as 10.102.29.30, to next hop router R1. PBR2 routes all the outgoing packets, with source IP address as 10.102.29.90, to next hop router R2. R3 is another next hop router connected to NS1.
If router R1 fails, all the outgoing packets that matched against PBR1 are dropped. To avoid this situation, you can specify a link load balancing (LLB) virtual server in the next hop field while creating or modifying a PBR. Multiple next hops are bound to the LLB virtual server as services (for example R1, R2, and R3). Now, if R1 fails, all the packets that matched against PBR1 are routed to R2 or R3 as determined by the LB method configured on the LLB virtual server.
The NetScaler appliance throws an error if you attempt to create a PBR with an LLB virtual server as the next hop in the following cases:
-
Adding another PBR with the same LLB virtual server.
-
Specifying a nonexistent LLB virtual server.
-
Specifying an LLB virtual server for which the bound services are not next hops.
-
Specifying an LLB virtual server for which the LB method is not set to one of the following:
-
ROUNDROBIN
-
DESTINATIONIPHASH
-
SOURCEIPHASH
-
SRCIPDESTIPHASH
-
LEASTPACKETS
-
LEASTBANDWIDTH
-
LTRM
-
CALLIDHASH
-
CUSTOM LOAD
-
Specifying an LLB virtual server for which the LB persistence type is not set to one of the following:
The following table lists the names and values of the entities configured on the NetScaler appliance:
| Entity Type |
Name |
IP Address |
| Link load balancing virtual server |
LLB1 |
NA |
| Services (next hops) |
Router1 |
1.1.1.254 |
|
Router2 |
2.2.2.254 |
|
Router3 |
3.3.3.254 |
| PBRs |
PBR1 |
NA |
|
PBR2 |
NA |
Table 1. Sample Values for Creating Entities
To implement the configuration described above, you need to:
-
Create services Router1, Router2, and Router3 that represent next hop routers R1, R2, and R3.
-
Create link load balancing virtual server LLB1 and bind services Router1, Router2, and Router3 to it.
-
Create PBRs PBR1 and PBR2, with next hop fields set as LLB1 and 2.2.2.254 (IP address of the router R2), respectively.
To create a service by using the CLI:
At the command prompt, type:
Example:
> add service Router1 1.1.1.254 ANY *
Done
> add service Router2 2.2.2.254 ANY *
Done
> add service Router3 3.3.3.254 ANY *
Done
To create a service by using the GUI:
Navigate to Traffic Management > Load Balancing > Services, and create a service.
To create a link load balancing virtual server and bind a service by using the CLI:
At the command prompt, type:
Example:
> add lb vserver LLB1 ANY
Done
> bind lb vserver LLB1 Router1 Router2 Router3
Done
To create a link load balancing virtual server and bind a service by using the GUI:
-
Navigate to Traffic Management > Load Balancing > Virtual Servers, and create a virtual server for link load balancing. Specify ANY in the Protocol field. Note: Make sure that Directly Addressable is unchecked.
-
Under the Services tab, in the Active column, select the check box for the service that you want to bind to the virtual server.
To create a PBR by using the CLI:
At the command prompt, type:
-
add ns pbr \<name> \<action> [-srcIP
\<srcIPVal>]
-
show ns pbr
Example:
> add pbr PBR1 ALLOW -srcIP 10.102.29.30 -nextHop LLB1
Done
> add pbr PBR2 ALLOW -srcIP 10.102.29.90 -nextHop 2.2.2.254
Done
To create a PBR by using the GUI:
Navigate to System > Network > PBRs, on the PBRs tab, add a new PBR.