學(xué)習(xí)啦 > 學(xué)習(xí)電腦 > 網(wǎng)絡(luò)知識(shí) > 路由器 > 路由器設(shè)置 > 華為路由器 > 華為路由器如何配置NAPT和NAT Server

華為路由器如何配置NAPT和NAT Server

時(shí)間: 權(quán)威724 分享

華為路由器如何配置NAPT和NAT Server

  華為的產(chǎn)品主要涉及通信網(wǎng)絡(luò)中的交換網(wǎng)絡(luò)、傳輸網(wǎng)絡(luò)、無(wú)線及有線固定接入網(wǎng)絡(luò)和數(shù)據(jù)通信網(wǎng)絡(luò)及無(wú)線終端產(chǎn)品,那么你知道華為路由器如何配置NAPT和NAT Server嗎?下面是學(xué)習(xí)啦小編整理的一些關(guān)于華為路由器如何配置NAPT和NAT Server的相關(guān)資料,供你參考。

  華為路由器配置NAPT和NAT Server的案例

  需求描述

  1.公司使用華為USG防火墻連接互聯(lián)網(wǎng),Trust區(qū)域192.168.1.0/24網(wǎng)段用戶可正常上網(wǎng),該區(qū)域其他網(wǎng)段禁止上網(wǎng)。USG出口IP:1.1.1.1/24 可用地址范圍:1.1.1.1--1.1.1.10,需要使用NAPT功能進(jìn)行地址復(fù)用,地址池:1.1.1.5--1.1.1.10。

  2.FTP和Web服務(wù)器供外部網(wǎng)絡(luò)用戶訪問(wèn),F(xiàn)TP服務(wù)器在VLAN 10,Web服務(wù)器在VLAN 20。其中FTP Server的IP地址為10.1.1.10,端口號(hào)為缺省值21,Web Server的IP地址為10.1.2.10,端口為80。兩者對(duì)外公布的地址分別為1.1.1.2和1.1.1.3,對(duì)外使用的端口號(hào)均為缺省值,即21和80。

  配置步驟

  1.交換機(jī)配置

  [SW]vlan batch 10 20

  [SW]interface Ethernet0/0/1

  [SW]port link-type access

  [SW]port default vlan 10

  [SW]interface Ethernet0/0/2

  [SW]port link-type access

  [SW]port default vlan 20

  [SW]interface GigabitEthernet0/0/1

  [SW]port link-type trunk

  [SW]port trunk allow-pass vlan 10 20

  2.USG設(shè)備配置個(gè)接口的IP地址,并將其加入相應(yīng)區(qū)域

  【USG】interface GigabitEthernet0/0/0.1

  【USG】vlan-type dot1q 10

  【USG】ip address 10.1.1.1 255.255.255.0

  【USG】interface GigabitEthernet0/0/0.2

  【USG】vlan-type dot1q 20

  【USG】ip address 10.1.2.1 255.255.255.0

  【USG】interface GigabitEthernet0/0/1

  【USG】ip address 192.168.1.1 255.255.255.0

  【USG】interface GigabitEthernet0/0/2

  【USG】ip address 1.1.1.1 255.255.255.0

  【USG】firewall zone trust

  【USG】add interface GigabitEthernet0/0/1

  【USG】firewall zone untrust

  【USG】add interface GigabitEthernet0/0/2

  【USG】firewall zone dmz

  【USG】add interface GigabitEthernet0/0/0

  【USG】add interface GigabitEthernet0/0/0.1

  【USG】add interface GigabitEthernet0/0/0.2

  3.配置地址池NAPT地址轉(zhuǎn)換

  【USG】nat address-group 10 1.1.1.5 1.1.1.10

  【USG】nat-policy interzone trust untrust outbound

  【USG】policy 1

  【USG】action source-nat

  【USG】policy source 192.168.1.0 0.0.0.255

  【USG】address-group 10

  4.配置區(qū)域間訪問(wèn)控制策略。

  【USG】policy interzone trust untrust outbound

  【USG】policy 0

  【USG】policy source 192.168.1.0 0.0.0.255

  【USG】action permit

  【USG】policy interzone dmz untrust inbound

  【USG】policy 0

  【USG】policy destination 10.1.1.10 0

  【USG】policy service service-set ftp

  【USG】action permit

  【USG】policy 1

  【USG】policy destination 10.1.2.10 0

  【USG】policy service service-set http

  【USG】action permit

  5.配置NAT Server對(duì)外發(fā)布服務(wù)器

  nat server 0 protocol tcp global 1.1.1.2 ftp inside 10.1.1.10 ftp

  nat server 1 protocol tcp global 1.1.1.3 www inside 10.1.2.10 www

  firewall interzone dmz untrust

  detect ftp

  6.測(cè)試

  a.在內(nèi)部PC上ping 1.1.1.100,然后在USG上查看NAT轉(zhuǎn)換,顯示NAT轉(zhuǎn)換正常。

  b.在外部用戶上測(cè)試訪問(wèn)FTP和Web服務(wù)器,USG上結(jié)果顯示正常。

  華為路由配置USG多出口策略的案例

  組網(wǎng)情況

  企業(yè)用戶主要有技術(shù)部(VLAN10)和行政部(VLAN20),通過(guò)匯聚交換機(jī)連接到USG。

  企業(yè)分別通過(guò)兩個(gè)不同運(yùn)營(yíng)商(ISP1和ISP2)連接到Internet,ISP1分配的IP地址是1.1.1.1~1.1.1.10,ISP2分配的IP地址是2.2.2.1~2.2.2.10,掩碼均為24位。

  需要實(shí)現(xiàn)以下需求

  當(dāng)通往兩個(gè)運(yùn)營(yíng)商鏈路都正常工作的情況下,技術(shù)部用戶通過(guò)運(yùn)營(yíng)商ISP1訪問(wèn)Internet互聯(lián)網(wǎng),行政部用戶通過(guò)運(yùn)營(yíng)商ISP2訪問(wèn)Internet。

  當(dāng)一條鏈路出現(xiàn)故障時(shí),流量可以被及時(shí)切換到另一條鏈路上,避免網(wǎng)絡(luò)長(zhǎng)時(shí)間中斷。

  匯聚SW配置:

  vlan batch 10 20

  interface GigabitEthernet0/0/1

  port link-type access

  port default vlan 10

  stp edged-port enable

  interface GigabitEthernet0/0/2

  port link-type access

  port default vlan 20

  stp edged-port enable

  interface GigabitEthernet0/0/24

  port link-type trunk

  port trunk allow-pass vlan 10 20

  USG配置:

  1.接口及區(qū)域配置

  interface GigabitEthernet0/0/0.1

  vlan-type dot1q 10

  alias GigabitEthernet0/0/0.1

  ip address 10.1.1.1 255.255.255.0

  dhcp select interface

  dhcp server gateway-list 10.1.1.1

  interface GigabitEthernet0/0/0.2

  vlan-type dot1q 20

  alias GigabitEthernet0/0/0.2

  ip address 10.1.2.1 255.255.255.0

  dhcp select interface

  dhcp server gateway-list 10.1.2.1

  interface GigabitEthernet0/0/1

  ip address 1.1.1.1 255.255.255.0

  interface GigabitEthernet0/0/2

  ip address 2.2.2.1 255.255.255.0

  firewall zone trust

  set priority 85

  add interface GigabitEthernet0/0/0

  add interface GigabitEthernet0/0/0.1

  add interface GigabitEthernet0/0/0.2

  firewall zone name isp1

  set priority 30

  add interface GigabitEthernet0/0/1

  firewall zone name isp2

  set priority 35

  add interface GigabitEthernet0/0/2

  2.域間策略配置

  policy interzone trust isp1 outbound

  policy 1

  action permit

  policy source 10.1.0.0 0.0.255.255

  policy interzone trust isp2 outbound

  policy 1

  action permit

  policy source 10.1.0.0 0.0.255.255

  3.NAT配置

  nat address-group 1 jishu 1.1.1.5 1.1.1.10

  nat address-group 2 xingzheng 2.2.2.5 2.2.2.10

  nat-policy interzone trust isp1 outbound

  policy 1

  action source-nat

  policy source 10.1.0.0 0.0.255.255

  address-group jishu

  nat-policy interzone trust isp2 outbound

  policy 1

  action source-nat

  policy source 10.1.0.0 0.0.255.255

  address-group xingzheng

  4.IP-Link鏈路檢測(cè)配置

  ip-link check enable

  ip-link 1 destination 1.1.1.100 interface GigabitEthernet 0/0/1 mode icmp

  ip-link 2 destination 2.2.2.100 interface GigabitEthernet 0/0/2 mode icmp

  5.策略路由配置

  acl number 3001

  rule 10 permit ip source 10.1.1.0 0.0.0.255

  acl number 3002

  rule 10 permit ip source 10.1.2.0 0.0.0.255

  policy-based-route huawei permit node 1

  if-match acl 3001

  apply ip-address next-hop 1.1.1.100

  policy-based-route huawei permit node 2

  if-match acl 3002

  apply ip-address next-hop 2.2.2.100

  分別在G0/0/0.1和G0/0/0.2上引用該策略路由

  interface GigabitEthernet0/0/0.1

  ip policy-based-route huawei

  interface GigabitEthernet0/0/0.2

  ip policy-based-route huawei

  分別輸入至ISP-1和ISP-2的兩條默認(rèn)路由

  ip route-static 0.0.0.0 0.0.0.0 1.1.1.100 track ip-link 1

  ip route-static 0.0.0.0 0.0.0.0 2.2.2.100 track ip-link 2

  http://www.luyouqiwang.com/huawei/

  ISP-1和ISP-2接口配置:

  ISP-1

  interface GigabitEthernet0/0/0

  ip address 1.1.1.100 255.255.255.0

  ISP-2

  interface GigabitEthernet0/0/0

  ip address 2.2.2.100 255.255.255.0

  測(cè)試

  1.分別在技術(shù)部和行政部電腦上ping 8.8.8.8 -t ,在USG輸入:display firewall session table verbose上查看NAT轉(zhuǎn)換情況。

  2.此時(shí)將ISP-1的G0/0/0口shutdown,觀察技術(shù)部是否會(huì)切換到ISP-2訪問(wèn)Internet。

  由上看出,技術(shù)部10.1.1.2已成功被轉(zhuǎn)換成2.2.2.10了。

  至此,這個(gè)華為設(shè)備的實(shí)驗(yàn)配置全部完成。

華為路由器如何配置NAPT和NAT Server的相關(guān)文章:

1.華為無(wú)線路由器的設(shè)置方法

2.華為路由器怎么隱藏你的WIFI信號(hào)

3.華為路由器配置詳細(xì)教程

4.華為路由器詳細(xì)介紹

5.華為路由器如何配置靜態(tài)路由

6.華為路由器設(shè)置wifi的詳細(xì)方法

574645