IP Prefix NAT
The Citrix ADC appliance supports translating a part of the source IP address instead of the complete address of packets received on the appliance. IP prefix NAT includes changing one or more octets or bits of the source IP address.
The Citrix ADC appliance supports IP prefix NAT for load balancing configurations of the following types: ANY, UDP, DNS, TCP, and HTTP.
Use Case: Zonification of Clients for a Deployment of a Citrix ADC appliance and an Optimization Device
IP prefix NAT is very useful in a deployment that includes a Citrix ADC appliance and an optimization device (for example, Citrix ByteMobile). This type of deployment has different geographically located client networks, which share the same network address. The Citrix ADC appliance must send the traffic received from each of the client networks to the optimization device before forwarding to the destination.
The device sends the optimized traffic back to the Citrix ADC appliance. Because the optimization requirement is different for traffic from each client network, the optimization device must recognize the client network of each packet that it receives. The solution is to segregate traffic from each client network into a different zone by using VLANs. IP prefix NAT with a different setting is configured for each zone. The Citrix ADC appliance translates the last octet of the source IP address of every packet, and the translated octet value is different for each zone.
Consider an example of two zones, Z1 and Z2, sharing network address 192.0.2.0/24. On the Citrix ADC appliance, IP prefix NAT entities named natrule-1 and natrule-2 are configured for these two zones. Before the appliance forwards a packet from Z1, natrule-1 translates the last octet of the packet’s source IP address to 100. Similarly, for packets from Z2, natrule-2 translates the last octet of the source IP address to 200. For two clients, CL1-Z1 in zone Z1 and CL1-Z2 in zone Z2, each with IP address 192.0.2.30, the Citrix ADC appliance translates the source IP address of CL1-Z1’s packets to 100.0.2.30 and of CL1-Z2’s packets to 200.0.2.30. The optimization device to which the Citrix ADC appliance sends the translated packets is configured to use a packet’s source IP address to recognize the zone, so it applies the appropriate optimization configured for the zone from which the packet originated.
Configuration Steps
Configuring IP prefix NAT consists of the following steps:
创建一个网络配置文件并设置NAT规则参数r of a net profile. A NAT rule specifies two IP addresses and a net mask. The first IP address (specified by IP Address parameter) is the source IP address that is to be translated with the second one (specified by IP Rewrite parameter). The net mask specifies the part of the source IP address that is to be translated with the same part of the second IP address.
Bind the net profile to load balancing virtual servers or services. A net profile with NAT rule setting can be bound to a virtual server or service of type ANY, UDP, DNS, TCP, and HTTP. After binding a net profile to a virtual server or service, the Citrix ADC appliance matches the source IP address of the incoming packets related to the virtual server or service with the NAT rule setting. The Citrix ADC then performs IP prefix NAT for packets that match the NAT rule.
To configure IP prefix NAT translation by using the command line:
At the command prompt, type:
- bind netProfile
(-natRule ) - show netprofile
To configure IP prefix NAT by using the GUI:
Navigate toSystem>Network>Net Profiles.
Set the following parameters under NAT Rules while adding or modifying NetProfiles.
- IP Address
- Netmask
- Rewrite IP
Sample configuration
In the following sample configuration, net profile PARTIAL-NAT-1 has IP prefix NAT settings and is bound to load balancing virtual server LBVS-1, which is of type ANY. For packets received on LBVS-1 from 192.0.0.0/8, the Citrix ADC appliance translates the last octet of the packet’s source IP address to 100. For example, a packet with source IP address 192.0.2.30 received on LBVS-1, the Citrix ADC appliance translates the source IP address to 100.0.2.30 before sending it one of the bound servers.
> add netprofile PARTIAL-NAT-1 Done > bind netprofile PARTIAL-NAT-1 –natrule 192.0.0.0 255.0.0.0 100.0.0.0 Done > add lb vserver LBVS-1 ANY 203.0.113. 61 * -netprofile PARTIAL-NAT-1 Done