• 全部
  • 经验案例
  • 典型配置
  • 技术公告
  • FAQ
  • 漏洞说明
  • 全部
  • 全部
  • 大数据引擎
  • 知了引擎
产品线
搜索
取消
案例类型
发布者
是否解决
是否官方
时间
搜索引擎
匹配模式
高级搜索

F1000-AI-25-- DNS-MAP MAPPING配置疑问

2022-11-21提问
  • 0关注
  • 0收藏,942浏览
粉丝:0人 关注:3人

问题描述:



nat global-policy

service http 

 service https 

 destination-ip host  出口IP 

 action dnat ip-address  内网IP

 counting enable 


防火墙上配置dns-map后,内网依然没法访问,请问是什么原因呢?需求是内外网用户均可以通过域名访问网站

组网及组网描述:


3 个回答
粉丝:226人 关注:1人

nat harpin开启了吗

暂无评论

粉丝:119人 关注:8人

看下案例配置有没有问题

3.18.11  NAT DNS mapping配置举例

1. 组网需求

某公司内部对外提供Web和FTP服务。公司内部网址为10.110.0.0/16。其中,Web服务器地址为10.110.10.1/16,FTP服务器地址为10.110.10.2/16。公司具有202.38.1.1至202.38.1.3三个公网IP地址。另外公司在外网有一台DNS服务器,IP地址为202.38.1.4。

需要实现如下功能:

·     选用202.38.1.2作为公司对外提供服务的IP地址。

·     外网用户可以通过域名或IP地址访问内部服务器。

·     内网用户可以通过域名访问内部服务器。

2. 组网图

图3-13 NAT DNS mapping配置组网图

3. 配置思路

·     内网服务器对外提供服务,需要配置NAT内部服务器将各服务器的内网IP地址和端口映射为一个外网地址和端口。

·     内网主机通过域名访问内网服务器时,首先需要通过出接口地址转换分配的外网地址访问外网的DNS服务器,并获取内网服务器的内网IP地址。由于DNS服务器向内网主机发送的响应报文中包含的是内网服务器的外网地址,因此NAT设备需要将DNS报文载荷内的外网地址转换为内网地址,这可以通过查找DNS mapping映射表配合DNS ALG功能实现。DNS mapping映射表用于实现根据“域名+外网IP地址+外网端口号+协议类型”查找到对应的“内网IP+内网端口号”。

4. 配置步骤

(1)     配置接口IP地址

# 根据组网图中规划的信息,配置各接口的IP地址,具体配置步骤如下。

<Device> system-view

[Device] interface gigabitethernet 1/0/1

[Device-GigabitEthernet1/0/1] ip address 10.110.10.10 16

[Device-GigabitEthernet1/0/1] quit

请参考以上步骤配置其他接口的IP地址,具体配置步骤略。

(2)     将接口加入安全域

# 请根据组网图中规划的信息,将接口加入对应的安全域,具体配置步骤如下。

[Device] security-zone name trust

[Device-security-zone-Trust] import interface gigabitethernet 1/0/1

[Device-security-zone-Trust] quit

[Device] security-zone name untrust

[Device-security-zone-Untrust] import interface gigabitethernet 1/0/2

[Device-security-zone-Untrust] quit

(3)     配置安全策略

# 配置名称为trust-untrust的安全策略,保证Trust安全域内的Host可以访问Untrust安全域内的DNS Server,具体配置步骤如下。

[Device] security-policy ip

[Device-security-policy-ip] rule name trust-untrust

[Device-security-policy-ip-1-trust-untrust] source-zone trust

[Device-security-policy-ip-1-trust-untrust] destination-zone untrust

[Device-security-policy-ip-1-trust-untrust] source-ip-subnet 10.110.0.0 16

[Device-security-policy-ip-1-trust-untrust] destination-ip-host 202.38.1.4

[Device-security-policy-ip-1-trust-untrust] action pass

[Device-security-policy-ip-1-trust-untrust] quit

# 配置名称为untrust-trust的安全策略,保证Untrust安全域内的Host可以访问Trust安全域内的Server,具体配置步骤如下。

[Device-security-policy-ip] rule name untrust-trust

[Device-security-policy-ip-2-untrust-trust] source-zone untrust

[Device-security-policy-ip-2-untrust-trust] destination-zone trust

[Device-security-policy-ip-2-untrust-trust] destination-ip-host 10.110.10.1

[Device-security-policy-ip-2-untrust-trust] destination-ip-host 10.110.10.2

[Device-security-policy-ip-2-untrust-trust] action pass

[Device-security-policy-ip-2-untrust-trust] quit

# 配置名称为trust-trust的安全策略,保证Trust安全域内的Host可以访问Trust安全域内的Server,具体配置步骤如下。

[Device-security-policy-ip] rule name trust-trust

[Device-security-policy-ip-3-trust-trust] source-zone trust

[Device-security-policy-ip-3-trust-trust] destination-zone trust

[Device-security-policy-ip-3-trust-trust] source-ip-host 202.38.1.1

[Device-security-policy-ip-3-trust-trust] destination-ip-host 10.110.10.1

[Device-security-policy-ip-3-trust-trust] destination-ip-host 10.110.10.2

[Device-security-policy-ip-3-trust-trust] action pass

[Device-security-policy-ip-3-trust-trust] quit

[Device-security-policy-ip] quit

(4)     配置NAT功能

# 开启DNS的NAT ALG功能。

[Device] nat alg dns

# 配置NAT内部Web服务器,允许外网主机使用地址202.38.1.2访问内网Web服务器。

[Device] interface gigabitethernet 1/0/2

[Device-GigabitEthernet1/0/2] nat server protocol tcp global 202.38.1.2 inside 10.110.10.1 http

# 配置NAT内部FTP服务器,允许外网主机使用地址202.38.1.2访问内网FTP服务器。

[Device-GigabitEthernet1/0/2] nat server protocol tcp global 202.38.1.2 inside 10.110.10.2 ftp

# 在接口GigabitEthernet1/0/2上配置Easy IP方式的出方向动态地址转换。

[Device-GigabitEthernet1/0/2] nat outbound

[Device-GigabitEthernet1/0/2] quit

# 配置两条DNS mapping表项:Web服务器的域名***.***对应IP地址202.38.1.2;FTP服务器的域名***.***对应IP地址202.38.1.2。

[Device] nat dns-map domain ***.*** protocol tcp ip 202.38.1.2 port http

[Device] nat dns-map domain ***.*** protocol tcp ip 202.38.1.2 port ftp

5. 验证配置

# 以上配置完成后,内网主机和外网主机均可以通过域名访问内网服务器。通过查看如下显示信息,可以验证以上配置成功。

[Device] display nat all

NAT outbound information:

  Totally 1 NAT outbound rules.

  Interface: GigabitEthernet1/0/2

    ACL: ---

    Address group ID: ---

    Port-preserved: N    NO-PAT: N         Reversible: N

    Config status: Active

 

NAT internal server information:

  Totally 2 internal servers.

  Interface: GigabitEthernet1/0/2

    Protocol: 6(TCP)

    Global IP/port: 202.38.1.2/21

    Local IP/port : 10.110.10.2/21

    Rule name     : ServerRule_2

    NAT counting  : 0

    Config status : Active

 

  Interface: GigabitEthernet1/0/2

    Protocol: 6(TCP)

    Global IP/port: 202.38.1.2/80

    Local IP/port : 10.110.10.1/80

    Rule name     : ServerRule_1

    NAT counting  : 0

    Config status : Active

 

NAT DNS mapping information:

  Totally 2 NAT DNS mappings.

  Domain name: ***.***

  Global IP  : 202.38.1.2

  Global port: 21

  Protocol   : TCP(6)

  Config status: Active

 

  Domain name: ***.***

  Global IP  : 202.38.1.2

  Global port: 80

  Protocol   : TCP(6)

  Config status: Active

 

NAT logging:

  Log enable          : Disabled

  Flow-begin          : Disabled

  Flow-end            : Disabled

  Flow-active         : Disabled

  Port-block-assign   : Disabled

  Port-block-withdraw : Disabled

  Alarm               : Disabled

  NO-PAT IP usage     : Disabled

 

NAT mapping behavior:

  Mapping mode : Address and Port-Dependent

  ACL          : ---

  Config status: Active

 

NAT ALG:

  DNS        : Enabled

  FTP        : Enabled

  H323       : Disabled

  ICMP-ERROR : Enabled

  ILS        : Disabled

  MGCP       : Disabled

  NBT        : Disabled

  PPTP       : Enabled

  RTSP       : Enabled

  RSH        : Disabled

  SCCP       : Disabled

  SCTP       : Disabled

  SIP        : Disabled

  SQLNET     : Disabled

  TFTP       : Disabled

  XDMCP      : Disabled

 

Static NAT load balancing:     Disabled

 

NAT link-switch recreate-session: Disabled

 

NAT configuration-for-new-connection: Disabled

# 通过以下显示命令,可以看到外网主机访问内网Web Server时生成NAT会话信息。

[Device] display nat session verbose

Slot 1:

Initiator:

  Source      IP/port: 202.38.1.10/63593

  Destination IP/port: 202.38.1.2/80

  DS-Lite tunnel peer: -

  VPN instance/VLAN ID/Inline ID: -/-/-

  Protocol: TCP(6)

  Inbound interface: GigabitEthernet1/0/2

  Source security zone: Untrust

Responder:

  Source      IP/port: 10.110.10.1/80

  Destination IP/port: 202.38.1.10/63593

  DS-Lite tunnel peer: -

  VPN instance/VLAN ID/Inline ID: -/-/-

  Protocol: TCP(6)

  Inbound interface: GigabitEthernet1/0/1

  Source security zone: Trust

State: TCP_ESTABLISHED

Application: HTTP

Rule ID: -/-/-

Rule name:

Start time: 2017-05-21 15:09:11  TTL: 11s

Initiator->Responder:            5 packets       1145 bytes

Responder->Initiator:            3 packets       1664 bytes

 

Total sessions found: 1

暂无评论

Mark_yao 知了小白
粉丝:0人 关注:3人

关键我端口下,就没有nat server 的命令

暂无评论

编辑答案

你正在编辑答案

如果你要对问题或其他回答进行点评或询问,请使用评论功能。

分享扩散:

提出建议

    +

亲~登录后才可以操作哦!

确定

亲~检测到您登陆的账号未在http://hclhub.h3c.com进行注册

注册后可访问此模块

跳转hclhub

你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作

举报

×

侵犯我的权益 >
对根叔社区有害的内容 >
辱骂、歧视、挑衅等(不友善)

侵犯我的权益

×

泄露了我的隐私 >
侵犯了我企业的权益 >
抄袭了我的内容 >
诽谤我 >
辱骂、歧视、挑衅等(不友善)
骚扰我

泄露了我的隐私

×

您好,当您发现根叔知了上有泄漏您隐私的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您认为哪些内容泄露了您的隐私?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)

侵犯了我企业的权益

×

您好,当您发现根叔知了上有关于您企业的造谣与诽谤、商业侵权等内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到 pub.zhiliao@h3c.com 邮箱,我们会在审核后尽快给您答复。
  • 1. 您举报的内容是什么?(请在邮件中列出您举报的内容和链接地址)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
  • 3. 是哪家企业?(营业执照,单位登记证明等证件)
  • 4. 您与该企业的关系是?(您是企业法人或被授权人,需提供企业委托授权书)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

抄袭了我的内容

×

原文链接或出处

诽谤我

×

您好,当您发现根叔知了上有诽谤您的内容时,您可以向根叔知了进行举报。 请您把以下内容通过邮件发送到pub.zhiliao@h3c.com 邮箱,我们会尽快处理。
  • 1. 您举报的内容以及侵犯了您什么权益?(请在邮件中列出您举报的内容、链接地址,并给出简短的说明)
  • 2. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

垃圾广告信息
色情、暴力、血腥等违反法律法规的内容
政治敏感
不规范转载 >
辱骂、歧视、挑衅等(不友善)
骚扰我
诱导投票

不规范转载

×

举报说明