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

防火墙怎么把某个地址及映射到外网?

2022-08-26提问
  • 0关注
  • 0收藏,839浏览
粉丝:0人 关注:2人

问题描述:

防火墙怎么把某个地址及映射到外网?

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

您好,参考

发布内网服务器配置案例

 

1 配置需求或说明

1.1  适用的产品系列

本案例适用于软件平台为Comware V7系列防火墙:F100-X-G2F1000-X-G2F100-WiNetF1000-AKF10X0

注:本案例是在F100-C-G2Version 7.1.064, Release 9510P08版本上进行配置和验证的。

1.2  配置需求及实现的效果

防火墙部署在互联网出口,内网有一台OA服务器192.168.1.88通过防火墙发布了8081端口到外网,内网用户使用192.168.1.88加端口号8081可以正常访问服务器,目前需要实现外用用户通过公网地址202.1.1.100加端口号8081访问OA服务器

2 组网图


3 配置步骤

3.1  配置内部服务器映射(端口映射)

#在外网口GigabitEthernet1/0/1上配置内部服务器映射:允许外网用户通过公网地址202.1.1.100、端口8081访问内部服务器192.168.1.888081端口

<H3C> system-view

[H3C] interface GigabitEthernet1/0/1

[H3C-GigabitEthernet1/0/1]ip add 202.1.1.100 255.255.255.248

[H3C-GigabitEthernet1/0/1]nat server protocol tcp global 202.1.1.100 8081 inside 192.168.1.88 8081

[H3C-GigabitEthernet1/0/1] quit

3.2  安全策略配置

防火墙目前版本存在两套安全策略,请在放通安全策略前确认设备运行那种类型的安全策略?以下配置任选其一。

1. 通过命令“display cu | in security-policy”如果查到命令行存在“security-policy disable”或者没有查到任何信息,则使用下面策略配置。

      #创建地址对象组,地址对象组名称为OA服务器

[H3C]object-group ip address OA服务器

[H3C-obj-grp-ip-OA服务器]network host address 192.168.1.88

[H3C-obj-grp-ip-OA服务器]quit

#创建服务对象组,服务对象组名称为8081端口,目的端口8081

[H3C]object-group service 8081端口

[H3C-obj-grp-service-8081端口]service tcp destination eq 8081

[H3C-obj-grp-service-8081端口]quit

#创建IPv4对象策略,策略名称为0A服务器

[H3C]object-policy ip OA服务器

[H3C-object-policy-ip-OA服务器]rule 0 pass destination-ip 0A服务器 service 8081端口

#创建安全策略,源安全域为Untrust目的安全域为Trust,放通外网访问OA服务器的8081端口

[H3C]zone-pair security source Untrust destination Trust

[H3C-zone-pair-security-Untrust-Trust]object-policy apply ip OA服务器

[H3C-zone-pair-security-Untrust-Trust]quit

2. 通过命令“display cu | in security-policy”如果查到命令行存在“security-policy ip”并且没有查到“security-policy disable”,则使用下面策略配置。

[H3C]display cu | in security-policy

security-policy ip

创建安全策略并放通源安全域为Untrust目的安全域为Trust,放通外网访问OA服务器的8081端口策略;

     #创建地址对象组,地址对象组名称为OA服务器

[H3C]object-group ip address OA服务器

[H3C-obj-grp-ip-OA服务器]network host address 192.168.1.88

[H3C-obj-grp-ip-OA服务器]quit

#创建服务对象组,服务对象组名称为8081端口,目的端口8081

[H3C]object-group service 8081端口

[H3C-obj-grp-service-8081端口]service tcp destination eq 8081

[H3C-obj-grp-service-8081端口]quit

创建安全策略并放通localtrusttrustlocal的安全策略。

[H3C]security-policy ip

[H3C-security-policy-ip]rule 10 name test

[H3C-security-policy-ip-10-test]action pass

[H3C-security-policy-ip-10-test]source-zone Untrust

[H3C-security-policy-ip-10-test]destination-zone Trust

[H3C-security-policy-ip-10-test]destination-ip OA服务器

[H3C-security-policy-ip-10-test]service 8081端口

[H3C-security-policy-ip-10-test]quit

3.3  保存配置

[H3C]save force

 

暂无评论

粉丝:148人 关注:1人

对外发布叫DNAT,找DNAT文档就行了


从内到外上网叫SNAT

暂无评论

粉丝:35人 关注:7人

您好,请知:

可以使用nat server的方式将内部的某个地址映射到外网并提供服务,以下是配置案例,请参考:

https://www.h3c.com/cn/d_202205/1609237_30005_0.htm#_Toc103002459


3.19.4  外网用户通过外网地址访问内网服务器配置举例

1. 组网需求

某公司内部对外提供Web、FTP和SMTP服务,而且提供两台Web服务器。公司内部网址为10.110.0.0/16。其中,内部FTP服务器地址为10.110.10.3/16,内部Web服务器1的IP地址为10.110.10.1/16,内部Web服务器2的IP地址为10.110.10.2/16,内部SMTP服务器IP地址为10.110.10.4/16。公司拥有202.38.1.1至202.38.1.3三个公网IP地址。需要实现如下功能:

·     外部的主机可以访问内部的服务器。

·     选用202.38.1.1作为公司对外提供服务的IP地址,Web服务器2对外采用8080端口。

2. 组网图

图3-6 外网用户通过外网地址访问内网服务器配置组网图

3. 配置步骤

(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)     配置安全策略

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

[Device] security-policy ip

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

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

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

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

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

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

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

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

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

[Device-security-policy-ip] quit

(4)     配置NAT功能

# 配置内部FTP服务器,允许外网主机使用地址202.38.1.1、端口号21访问内网FTP服务器。

[Device] interface gigabitethernet 1/0/2

[Device-GigabitEthernet1/0/2] nat server protocol tcp global 202.38.1.1 21 inside 10.110.10.3 ftp

# 配置内部Web服务器1,允许外网主机使用地址202.38.1.1、端口号80访问内网Web服务器1。

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

# 配置内部Web服务器2,允许外网主机使用地址202.38.1.1、端口号8080访问内网Web服务器2。

[Device-GigabitEthernet1/0/2] nat server protocol tcp global 202.38.1.1 8080 inside 10.110.10.2 http

# 配置内部SMTP服务器,允许外网主机使用地址202.38.1.1以及SMTP协议定义的端口访问内网SMTP服务器。

[Device-GigabitEthernet1/0/2] nat server protocol tcp global 202.38.1.1 smtp inside 10.110.10.4 smtp

[Device-GigabitEthernet1/0/2] quit

4. 验证配置

# 以上配置完成后,外网Host能够通过NAT地址访问各内网服务器。通过查看如下显示信息,可以验证以上配置成功。

[Device] display nat all

NAT internal server information:

  Totally 4 internal servers.

  Interface: GigabitEthernet1/0/2

    Protocol: 6(TCP)

    Global IP/port: 202.38.1.1/21

    Local IP/port : 10.110.10.3/21

    Rule name     : ServerRule_1

    NAT counting  : 0

    Config status : Active

 

  Interface: GigabitEthernet1/0/2

    Protocol: 6(TCP)

    Global IP/port: 202.38.1.1/25

    Local IP/port : 10.110.10.4/25

    Rule name     : ServerRule_4

    NAT counting  : 0

    Config status : Active

 

  Interface: GigabitEthernet1/0/2

    Protocol: 6(TCP)

    Global IP/port: 202.38.1.1/80

    Local IP/port : 10.110.10.1/80

    Rule name     : ServerRule_2

    NAT counting  : 0

    Config status : Active

 

  Interface: GigabitEthernet1/0/2

    Protocol: 6(TCP)

    Global IP/port: 202.38.1.1/8080

    Local IP/port : 10.110.10.2/80

    Rule name     : ServerRule_3

    NAT counting  : 0

    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

  SIP        : Disabled

  SQLNET     : Disabled

  TFTP       : Disabled

  XDMCP      : Disabled

 

Static NAT load balancing:     Disabled

# 通过以下显示命令,可以看到Host访问FTP server时生成NAT会话信息。

[Device] display nat session verbose

Slot 1:

Initiator:

  Source      IP/port: 202.38.1.2/52802

  Destination IP/port: 202.38.1.1/21

  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.3/21

  Destination IP/port: 202.38.1.2/52802

  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: FTP

Rule ID: -/-/-

Rule name:

Start time: 2017-05-21 11:13:39  TTL: 3597s

Initiator->Responder:            7 packets        313 bytes

Responder->Initiator:            6 packets        330 bytes

 

Total sessions found: 1

暂无评论

编辑答案

你正在编辑答案

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

分享扩散:

提出建议

    +

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

确定

亲~检测到您登陆的账号未在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. 您是谁?(身份证明材料,可以是身份证或护照等证件)
我们认为知名企业应该坦然接受公众讨论,对于答案中不准确的部分,我们欢迎您以正式或非正式身份在根叔知了上进行澄清。

对根叔社区有害的内容

×

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

不规范转载

×

举报说明