This section provides an example for configuring NAPT for users on a Layer-2 intranet to access the Internet.
As shown in Figure 1, the FW is deployed in transparent mode to keep the network topology unchanged. Its upstream and downstream interfaces work in Layer-2 mode.
A source NAT policy must be configured on the FW to allow users in network segment 10.1.1.0/24 to access the Internet. In addition to public IP addresses of interfaces on the egress gateway, the enterprise applies for six IP addresses (1.1.1.10 to 1.1.1.15) for NAT.
Item |
Data |
Description |
|
|---|---|---|---|
GigabitEthernet 0/0/1 |
VLAN: 100 Security zone: trust |
- |
|
GigabitEthernet 0/0/2 |
VLAN: 100 Security zone: untrust |
- |
|
Intranet segment that is allowed to access the Internet |
10.1.1.0/24 |
- |
|
Public addresses mapped to private addresses |
1.1.1.10 to 1.1.1.15 |
As private addresses far outnumber public addresses, one-to-one mapping cannot be implemented. To translate all private addresses into public addresses, enable port translation. |
|
Routing information |
Black-hole routes on the aggregation switch |
Destination address: 1.1.1.10 to 1.1.1.15 Next hop: NULL0 |
Routing loops are made between the aggregation switch and egress gateway to prevent Internet users from accessing the after-NAT public addresses. |
Static routes on the egress gateway |
Destination address: 1.1.1.10 to 1.1.1.15 Next hop: 10.1.2.1 |
- |
|
Static routes on the ISP router |
Destination address: 1.1.1.10 to 1.1.1.15 Next hop address: 1.1.1.1 |
The public addresses mapped to private addresses are not assigned to physical ports. As a result, the router cannot use a routing protocol to discover routes to the public addresses. Ask the ISP network administrator to configure a static route destined for the network segment address of the address pool on the router. |
|
The configuration roadmap is as follows:
<switch> system-view [switch] ip route-static 1.1.1.10 32 NULL0 [switch] ip route-static 1.1.1.11 32 NULL0 [switch] ip route-static 1.1.1.12 32 NULL0 [switch] ip route-static 1.1.1.13 32 NULL0 [switch] ip route-static 1.1.1.14 32 NULL0 [switch] ip route-static 1.1.1.15 32 NULL0
<router> system-view [router] ip route-static 1.1.1.10 32 10.1.2.1 [router] ip route-static 1.1.1.11 32 10.1.2.1 [router] ip route-static 1.1.1.12 32 10.1.2.1 [router] ip route-static 1.1.1.13 32 10.1.2.1 [router] ip route-static 1.1.1.14 32 10.1.2.1 [router] ip route-static 1.1.1.15 32 10.1.2.1
Contact your ISP administrator to perform this step.
Configuration script for the FW:
# sysname FW # vlan batch 100 # interface GigabitEthernet0/0/1 portswitch undo shutdown port link-type access port default vlan 100 # interface GigabitEthernet0/0/2 portswitch undo shutdown port link-type access port default vlan 100 # firewall zone trust set priority 85 add interface GigabitEthernet0/0/1 # firewall zone untrust set priority 5 add interface GigabitEthernet0/0/2 # nat address-group addressgroup1 0 mode pat route enable section 0 1.1.1.10 1.1.1.15 # security-policy rule name policy1 source-zone trust destination-zone untrust source-address 10.1.1.0 24 action permit # nat-policy rule name policy_nat1 source-zone trust destination-zone untrust source-address 10.1.1.0 24 action source-nat address-group addressgroup1 # return