1.實驗拓撲
2.實驗配置
[SW1]dis cu
#
sysname SW1
#
vlan batch 10 20
#
interface Vlanif10ip address 192.168.10.254 255.255.255.0
#
interface Vlanif20ip address 192.168.20.253 255.255.255.0
#
interface GigabitEthernet0/0/1port link-type accessport default vlan 20
#
interface GigabitEthernet0/0/2port link-type accessport default vlan 10
#
interface GigabitEthernet0/0/3port link-type accessport default vlan 10
#
ospf 1 router-id 1.1.1.1silent-interface Vlanif10area 0.0.0.0network 192.168.10.0 0.0.0.255network 192.168.20.0 0.0.0.255
#
[FW1]dis cu
2025-05-29 12:57:31.360
!Software Version V500R005C10SPC300
#
sysname FW1
#
interface GigabitEthernet1/0/0undo shutdownip address 192.168.20.254 255.255.255.0
#
interface GigabitEthernet1/0/1undo shutdownip address 200.1.1.1 255.255.255.0
#
firewall zone trustset priority 85add interface GigabitEthernet0/0/0add interface GigabitEthernet1/0/0
#
firewall zone untrustset priority 5add interface GigabitEthernet1/0/1
#
ospf 1 router-id 2.2.2.2default-route-advertisearea 0.0.0.0network 192.168.20.0 0.0.0.255
#
ip route-static 0.0.0.0 0.0.0.0 200.1.1.2
#
nat address-group 1 0mode patsection 0 200.1.1.10 200.1.1.20
#
security-policyrule name trust->untrustsource-zone trustdestination-zone untrustsource-address range 192.168.10.1 192.168.10.2service httpservice httpsservice icmpaction permit
#
nat-policyrule name patsource-zone trustdestination-zone untrustsource-address 192.168.10.0 mask 255.255.255.0action source-nat address-group 1
#
[R1]dis cu
[V200R003C00]
#sysname R1
#
interface GigabitEthernet0/0/0ip address 200.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1ip address 100.1.1.254 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 200.1.1.1
3.實驗驗證
4.配置源NAT注意事項
1、邊界防火墻地址池配置的公網 IP 與公網接口在一個網段,如果外網節點頻繁訪問防火墻
上地址池中的公網 IP,觸發大量的 ARP 解析報文,造成資源占用,引入 UNR(user network
route)路由,類似黑洞路由,把訪問地址池中公網 IP 的數據本地終結。

[FW1-address-group-1] route ?enable?


此時不再生成ARP請求
2、邊界防火墻地址池配置的公網 IP 與公網接口在不一個網段,如果外網節點訪問防火墻上
地址池中的公網 IP,會導致三層環路,消耗設備、鏈路資源,一定要配置 UNR 路由生成功
能,用本地終結方式,防止環路的發生。
[FW1]nat address-group ?1
[FW1-address-group-1]undo route ?enable?
[FW1-address-group-1]undo section ?0[FW1-address-group-1]section ?4.4.4.4



[FW1-address-group-1]route ?enable?

此時沒有環路了
