Configuring NAT
Configuring indirect-mode NAT
Indirect-mode NAT configuration requires disabling NAT for the server farm.
To configure indirect-mode NAT:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Enter server farm view. | server-farm server-farm-name | N/A |
3. Disable NAT for the server farm. | transparent enable | By default, NAT is enabled for a server farm. If the server farm is referenced by a virtual server of the HTTP type, the NAT feature takes effect even if it is disabled. |
Configuring NAT-mode NAT
The NAT-mode NAT configuration varies by NAT mode.
For DNAT mode, you only need to enable NAT for the server farm.
For SNAT mode and DNAT + SNAT mode, you must create an SNAT address pool to be referenced by the server farm.
After the server farm references the SNAT address pool, the LB device replaces the source address of the packets it receives with an SNAT address before forwarding the packets.
An SNAT address pool can have a maximum of 256 IPv4 addresses and 65536 IPv6 addresses. No overlapping IPv4 or IPv6 addresses are allowed in different SNAT address pools.
To configure NAT-mode NAT:
Step | Command | Remarks |
---|---|---|
1. Enter system view. | system-view | N/A |
2. Create an SNAT address pool and enter SNAT address pool view. | loadbalance snat-pool pool-name | By default, no SNAT address pools exist. Skip this step for DNAT mode. |
3. (Optional.) Set a description for the SNAT address pool. | description text | By default, no description is set for an SNAT address pool. Skip this step for DNAT mode. |
4. Specify an address range for the SNAT address pool. |
| By default, no address range is specified for an SNAT address pool. Skip this step for DNAT mode. |
5. Return to system view. | quit | N/A |
6. Enter server farm view. | server-farm server-farm-name | N/A |
7. Enable NAT for the server farm. | undo transparent enable | By default, NAT is enabled for a server farm. If a server farm is referenced by a virtual server of the HTTP type, the NAT feature takes effect even when it is disabled. |
8. Specify the SNAT address pool to be referenced by the server farm. | snat-pool pool-name | By default, no SNAT address pool is referenced by a server farm. Skip this step for DNAT mode. |