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

防火墙内网用户通过公网域名访问内部服务器典型配置案例集

2015-07-28 发表
  • 0关注
  • 3收藏 8347浏览
张辛 四段
粉丝:0人 关注:0人

1、PC和服务器的网关都在核心交换机上。

2、PC通过运营商A上公网,服务器通过运营商B上公网。

3、公网用户通过运营商B访问内网服务器。

4、PC使用DNS服务器为公网DNS

5、PC通过域名***.***访问内网服务器,公网DNS解析该域名IP123.1.1.1



1)防火墙开启ALG DNS功能。

核心交换机配置:

核心交换机上配置PC和服务器的网关,缺省路由指向防火墙,具体配置略。

防火墙配置:

1、在接口G0/0G0/1G0/2上配置相应的地址,正确配置路由和域间策略,具体配置略。

2、通过PBRPC访问公网的流量重定向至运营商APC访问服务器的流量不做重定向。

#

[F1000-E-SI]acl number 3010

[F1000-E-SI-acl-adv-3010]rule permit ip source 192.168.1.5 0

[F1000-E-SI-acl-adv-3000]quit

#

[F1000-E-SI]policy-based-route PC-WAN permit node 10

[F1000-E-SI-pbr-PC-WAN-10]if-match acl 3010

[F1000-E-SI-pbr-PC-WAN-10] apply ip-address next-hop 58.1.1.2

#

[F1000-E-SI]interface GigabitEthernet 0/0

[F1000-E-SI-GigabitEthernet0/0]ip policy-based-route PC-WAN

#

3、在防火墙上开启ALG DNS功能。(缺省是关闭的,开启后配置中无显示。)

#

[F1000-E-SI]alg dns

#

4、在接口G0/1上配置nat serverPC上公网的nat outbound功能。

#

[F1000-E-SI]interface GigabitEthernet 0/1

[F1000-E-SI-GigabitEthernet0/1nat outbound 3010

[F1000-E-SI-GigabitEthernet0/1]nat server protocol tcp global 123.1.1.1 www inside 192.168.99.5 www

#

5、在接口G0/2上配置nat server和服务器上公网的nat outbound功能。

[F1000-E-SI]acl number 3020

[F1000-E-SI-acl-adv-3020]rule permit ip source 192.168.99.5 0

[F1000-E-SI-acl-adv-3020]quit

#

[F1000-E-SI]interface GigabitEthernet 0/2

[F1000-E-SI-GigabitEthernet0/2]nat outbound 3020

[F1000-E-SI-GigabitEthernet0/2]nat server protocol tcp global 123.1.1.1 www inside 192.168.99.5 www

#

完整配置:

#

 undo alg ftp

 undo alg rtsp

 undo alg h323

 undo alg sip  

 undo alg sqlnet

 undo alg pptp

 undo alg ils

 undo alg nbt

 undo alg msn

 undo alg qq

 undo alg tftp

 undo alg sccp

 undo alg gtp

#

acl number 3010

 rule 0 permit ip source 192.168.1.5 0

acl number 3020

 rule 0 permit ip source 192.168.99.5 0

#

policy-based-route PC-WAN permit node 10

 if-match acl 3010

 apply ip-address next-hop 58.1.1.2

#

interface GigabitEthernet0/0

 port link-mode route

 ip address 192.168.255.1 255.255.255.252

 ip policy-based-route PC-WAN

#

interface GigabitEthernet0/1

 port link-mode route

 nat outbound 3010

 nat server protocol tcp global 123.1.1.1 www inside 192.168.99.5 www

 ip address 58.1.1.1 255.255.255.252

#

interface GigabitEthernet0/2

 port link-mode route

 nat outbound 3020

 nat server protocol tcp global 123.1.1.1 www inside 192.168.99.5 www  

 ip address 202.2.2.1 255.255.255.252

#

 ip route-static 0.0.0.0 0.0.0.0 202.2.2.2

 ip route-static 192.168.0.0 255.255.0.0 192.168.255.2

#

 

2)防火墙不开启ALG DNS功能。

核心交换机配置:

核心交换机上配置PC和服务器的网关,缺省路由指向防火墙,具体配置略。

防火墙配置:

1、在接口G0/0G0/1G0/2上配置相应的地址,正确配置路由和域间策略,具体配置略。

2、通过PBRPC访问公网的流量重定向至运营商APC访问服务器的流量不做重定向。

#

[F1000-E-SI]acl number 3000

[F1000-E-SI-acl-adv-3000]rule permit ip source 192.168.1.5 0 destination 192.168.99.5 0

[F1000-E-SI-acl-adv-3000]quit

#

[F1000-E-SI]acl number 3010

[F1000-E-SI-acl-adv-3010]rule permit ip source 192.168.1.5 0

[F1000-E-SI-acl-adv-3000]quit

#

[F1000-E-SI]policy-based-route PC-WAN deny node 5

[F1000-E-SI-pbr-PC-WAN-5]if-match acl 3000

[F1000-E-SI-pbr-PC-WAN-5]quit

[F1000-E-SI]policy-based-route PC-WAN permit node 10

[F1000-E-SI-pbr-PC-WAN-10]if-match acl 3010

[F1000-E-SI-pbr-PC-WAN-10] apply ip-address next-hop 58.1.1.2

#

[F1000-E-SI]interface GigabitEthernet 0/0

[F1000-E-SI-GigabitEthernet0/0]ip policy-based-route PC-WAN

#

3、在接口G0/0上配置nat serverPC访问服务器的nat outbound功能。

#

[F1000-E-SI]interface GigabitEthernet 0/0

[F1000-E-SI-GigabitEthernet0/2]nat outbound 3000

[F1000-E-SI-GigabitEthernet0/2]nat server protocol tcp global 123.1.1.1 www inside 192.168.99.5 www

#

4、在接口G0/1上配置PC上公网的nat outbound功能。

#

[F1000-E-SI]interface GigabitEthernet 0/1

[F1000-E-SI-GigabitEthernet0/2]nat outbound 3010

#

5、在接口G0/2上配置nat server和服务器上公网的nat outbound功能。

[F1000-E-SI]acl number 3020

[F1000-E-SI-acl-adv-3020]rule permit ip source 192.168.99.5 0

[F1000-E-SI-acl-adv-3020]quit

#

[F1000-E-SI]interface GigabitEthernet 0/2

[F1000-E-SI-GigabitEthernet0/2]nat outbound 3020

[F1000-E-SI-GigabitEthernet0/2]nat server protocol tcp global 123.1.1.1 www inside 192.168.99.5 www

#

完整配置:

#

 undo alg all

#

acl number 3000

 rule 5 permit ip source 192.168.1.5 0 destination 192.168.99.5 0

acl number 3010

 rule 0 permit ip source 192.168.1.5 0

acl number 3020

 rule 0 permit ip source 192.168.99.5 0

#

policy-based-route PC-WAN deny node 5

 if-match acl 3000

policy-based-route PC-WAN permit node 10

 if-match acl 3010

 apply ip-address next-hop 58.1.1.2

#

interface GigabitEthernet0/0

 port link-mode route

nat outbound 3000

 nat server protocol tcp global 123.1.1.1 www inside 192.168.99.5 www

 ip address 192.168.255.1 255.255.255.252

 ip policy-based-route PC-WAN

#

interface GigabitEthernet0/1

 port link-mode route

 nat outbound 3010

ip address 58.1.1.1 255.255.255.252

#

interface GigabitEthernet0/2

 port link-mode route

 nat outbound 3020

 nat server protocol tcp global 123.1.1.1 www inside 192.168.99.5 www

 ip address 202.2.2.1 255.255.255.252

#

 ip route-static 0.0.0.0 0.0.0.0 202.2.2.2

 ip route-static 192.168.0.0 255.255.0.0 192.168.255.2

#

 


1、在接口同时配置有PBRNAT的情况下,报文优先匹配NAT。做完NAT转换后,再进行PBR匹配。

2、开启ALG DNS功能时,PC通过域名访问服务器时,只需要在防火墙公网DNS报文入接口上配置相应的NAT SERVER,设备会自动将DNS报文中的公网地址替换为NAT SERVER映射的内网地址。防火墙内网口不需要做任何配置。

3、不开启ALG DNS功能时,PC通过域名访问服务器时,要在防火墙内网口配置NAT SERVERNAT OUTBOUND,使PC访问服务器的流量通过防火墙绕行,保障来回路径一致。同时保证PC访问服务器的流量不被PBR做重定向。

4、如果客户要使用公网地址访问内网服务器,则需使用方案二。


该案例对您是否有帮助:

您的评价:1

若您有关于案例的建议,请反馈:

作者在2019-06-12对此案例进行了修订
1 个评论
粉丝:0人 关注:0人

“在接口同时配置有PBRNAT的情况下,报文优先匹配NAT。做完NAT转换后,再进行PBR匹配。”

这句话很重要-。-,搞了好几个小时,原来是PBR排除项地址写错了

编辑评论

举报

×

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

侵犯我的权益

×

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

泄露了我的隐私

×

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

侵犯了我企业的权益

×

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

抄袭了我的内容

×

原文链接或出处

诽谤我

×

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

对根叔知了社区有害的内容

×

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

不规范转载

×

举报说明

提出建议

    +

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

确定

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

注册后可访问此模块

跳转hclhub

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