十三、NAT服务器转发

  华为nat内网服务器映射外网需要配置NAT Server映射,NAT Server映射具有“屏蔽”内部主机的作用,但有时内网需要向外网提供服务,比如提供WWW服务或者FTP服务。这种情况下需要内网的服务器不被“屏蔽”,外网用户可以随时访问内网服务器。

  NAT Server可以很好地解决这个问题,当外网用户访问内网服务器时,它通过事先配置好的“公网IP地址+端口号”与“私网IP地址+端口号”间的映射关系,将服务器的“公网IP地址+端口号”根据映射关系替换成对应的“私网IP地址+端口号”。

 配置192.168.1.2 内网80    外网8088

配置192.168.2.2  内网80   外网8090

外网服务器通过ip +外网端口的形式访问局域 网中指定的服务器

服务器外网映射

1.配置接口IP

<Huawei>sys
[Huawei]sysname AR7
[AR7]int g0/0/0
[AR7-GigabitEthernet0/0/0]ip add 192.168.1.1 24
[AR7-GigabitEthernet0/0/0]int g0/0/2
[AR7-GigabitEthernet0/0/2]ip add 192.168.2.1 24
[AR7-GigabitEthernet0/0/2]int g0/0/1
[AR7-GigabitEthernet0/0/1]ip add 111.11.1.1 24
[AR7-GigabitEthernet0/0/1]quit

2.接口配置映射

[AR7]int g0/0/1
[AR7-GigabitEthernet0/0/1]nat server protocol tcp global 10.0.0.1 8080 inside 192.168.1.2 80
[AR7-GigabitEthernet0/0/1]nat server protocol tcp global 10.0.0.1 8090 inside 192.168.2.2 80

3.开启使能FTP的NAT ALG功能

[AR7]nat alg ftp enable

最后看一下结果:

[AR7-GigabitEthernet0/0/1]dis nat server

  Nat Server Information:
  Interface  : GigabitEthernet0/0/1
    Global IP/Port     : 10.0.0.1/8080 
    Inside IP/Port     : 192.168.1.2/80(www)
    Protocol : 6(tcp)   
    VPN instance-name  : ----                            
    Acl number         : ----
    Description : ----

    Global IP/Port     : 10.0.0.1/8090 
    Inside IP/Port     : 192.168.2.2/80(www)
    Protocol : 6(tcp)   
    VPN instance-name  : ----                            
    Acl number         : ----
    Description : ----
[AR7-GigabitEthernet0/0/1]dis nat alg

NAT Application Level Gateway Information
:
----------------------------------
  Application            Status
----------------------------------
  dns                    Disabled
  ftp                    Disabled
  rtsp                   Disabled
  sip                    Disabled
----------------------------------

猜你喜欢

转载自www.cnblogs.com/mr-xiong/p/12970072.html
今日推荐