具體需求如下:
- 需求一:企業內網10.1.1.10/24~10.1.1.20/24的用戶可以訪問公網,其他內網用戶不允許訪問公網。
- 需求二:企業內網所有用戶可以通過域名訪問DMZ安全區域的Web服務器,通過公網IP地址訪問FTP服務器。
- 需求三:公網用戶可以通過域名訪問DMZ安全區域的Web服務器。
- 需求四:DMZ安全區域的服務器之間可以使用域名或者公網地址互相訪問,比如FTP服務器可以採用域名訪問Web服務器。
數據規劃
NAT Outbound+NAT Server典型配置舉例的數據規劃如表1所示。
項目 | 數據 | 備註 |
---|---|---|
(1) |
接口編號:GigabitEthernet 0/0/0 IP地址:10.1.1.1/24 |
無 |
(2) |
接口編號:GigabitEthernet 0/0/1 IP地址:202.168.1.1/24 |
無 |
(3) |
接口編號:GigabitEthernet 0/0/2 IP地址:192.168.1.1/24 |
無 |
安全區域 |
Trust:GigabitEthernet 0/0/0 DMZ:GigabitEthernet 0/0/2 Untrust:GigabitEthernet 0/0/1 |
無 |
FTP服務器 |
私網IP地址:192.168.1.2/24 公網IP地址:202.168.10.10/24 |
無論私網用戶還是公網用戶,均通過公網地址訪問FTP服務器。 |
Web服務器 |
私網IP地址:192.168.1.3/24 公網IP地址:202.168.10.20/24 |
無論私網用戶還是公網用戶,均通過域名訪問Web服務器。 |
用戶網段 |
10.1.1.10/24~10.1.1.20/24 |
此網段的內網用戶可以訪問公網,其他內網用戶不允許訪問公網。 |
地址池 |
編號:1 IP地址:202.168.1.10/24~202.168.1.15/24 編號:2 IP地址:202.168.10.2/24~202.168.10.3/24 |
地址池1用於內網用戶訪問公網。 地址池2用於FTP服務器和Web服務器互相訪問。 |
配置思路
- 配置USG5300的接口IP地址並將接口加入相應安全區域。
- 配置域間防火牆策略。
- 配置Trust到Untrust的NAT Outbound,實現需求一。
- 配置NAT Server,實現需求二和需求三。
- 配置DMZ的域內NAT,實現需求四。
操作步驟
- 配置USG5300的接口IP地址並將接口加入對應安全區域。
# 配置USG5300接口IP地址。
<USG5300> system-view [USG5300] interface GigabitEthernet 0/0/0 [USG5300-GigabitEthernet0/0/0] ip address 10.1.1.1 24 [USG5300-GigabitEthernet0/0/0] quit [USG5300] interface GigabitEthernet 0/0/1 [USG5300-GigabitEthernet0/0/1] ip address 202.168.1.1 24 [USG5300-GigabitEthernet0/0/1] quit [USG5300] interface GigabitEthernet 0/0/2 [USG5300-GigabitEthernet0/0/2] ip address 192.168.1.1 24 [USG5300-GigabitEthernet0/0/2] quit
# 將USG5300接口加入安全區域。
[USG5300] firewall zone trust [USG5300-zone-trust] add interface GigabitEthernet 0/0/0 [USG5300-zone-trust] quit [USG5300] firewall zone untrust [USG5300-zone-untrust] add interface GigabitEthernet 0/0/1 [USG5300-zone-untrust] quit [USG5300] firewall zone dmz [USG5300-zone-dmz] add interface GigabitEthernet 0/0/2 [USG5300-zone-dmz] quit
- 配置域間防火牆策略。
# 配置Trust與Untrust域間防火牆策略。
[USG5300] ip address-set add type object [USG5300-object-address-set-add] address range 10.1.1.10 10.1.1.20 [USG5300-object-address-set-add] quit [USG5300] policy interzone trust untrust outbound [USG5300-policy-interzone-trust-untrust-outbound] policy 1 [USG5300-policy-interzone-trust-untrust-outbound-1] policy source address-set add [USG5300-policy-interzone-trust-untrust-outbound-1] action permit [USG5300-policy-interzone-trust-untrust-outbound-1] quit [USG5300-policy-interzone-trust-untrust-outbound] quit
# 配置Trust與DMZ域間防火牆策略。
[USG5300] policy interzone trust dmz outbound [USG5300-policy-interzone-trust-dmz-outbound] policy 1 [USG5300-policy-interzone-trust-dmz-outbound-1] policy destination range 192.168.1.2 192.168.1.3 [USG5300-policy-interzone-trust-dmz-outbound-1] action permit [USG5300-policy-interzone-trust-dmz-outbound-1] quit [USG5300-policy-interzone-trust-dmz-outbound] quit # 配置Untrust與DMZ域間防火牆策略。
[USG5300] policy interzone dmz untrust inbound [USG5300-policy-interzone-dmz-untrust-inbound] policy 1 [USG5300-policy-interzone-dmz-untrust-inbound-1] policy destination range 192.168.1.2 192.168.1.3 [USG5300-policy-interzone-dmz-untrust-inbound-1] action permit [USG5300-policy-interzone-dmz-untrust-inbound-1] quit [USG5300-policy-interzone-dmz-untrust-inbound] quit
- 配置Trust到Untrust的NAT Outbound,實現需求一。
# 配置NAT地址池。
[USG5300] nat address-group 1 202.168.1.10 202.168.1.15
# 配置Trust到Untrust的NAT Outbound。
[USG5300] nat-policy interzone trust untrust outbound [USG5300-nat-policy-interzone-trust-untrust-outbound] policy 1 [USG5300-nat-policy-interzone-trust-untrust-outbound-1] policy source address-set add [USG5300-nat-policy-interzone-trust-untrust-outbound-1] action source-nat [USG5300-nat-policy-interzone-trust-untrust-outbound-1] address-group 1 [USG5300-nat-policy-interzone-trust-untrust-outbound-1] quit [USG5300-nat-policy-interzone-trust-untrust-outbound] quit
- 配置NAT Server,實現需求二和需求三。
# 配置NAT Server。
[USG5300] nat server global 202.168.10.10 inside 192.168.1.2 [USG5300] nat server global 202.168.10.20 inside 192.168.1.3
# 配置FTP的NAT ALG。
[USG5300] firewall interzone trust dmz [USG5300-interzone-trust-dmz] detect ftp [USG5300-interzone-trust-dmz] quit [USG5300] firewall interzone untrust dmz [USG5300-interzone-dmz-untrust] detect ftp [USG5300-interzone-dmz-untrust] quit
- 配置DMZ安全區域的域內NAT,實現需求四。
# 配置NAT地址池。
[USG5300] nat address-group 2 202.168.10.2 202.168.10.3
# 配置域內NAT和FTP的NAT ALG功能。
[USG5300] nat-policy zone dmz [USG5300-nat-policy-zone-dmz] policy 1 [USG5300-nat-policy-zone-dmz-1] policy source range 192.168.1.2 192.168.1.3 [USG5300-nat-policy-zone-dmz-1] action source-nat [USG5300-nat-policy-zone-dmz-1] address-group 2 [USG5300-nat-policy-zone-dmz-1] quit [USG5300-nat-policy-zone-dmz] quit [USG5300] firewall zone dmz [USG5300-zone-dmz] detect ftp [USG5300-zone-dmz] quit