雏鹰部落

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 3335|回复: 5

[讨论/求助] 求助关于junier回流问题

[复制链接]
发表于 2012-7-10 09:02:05 | 显示全部楼层 |阅读模式
大神们求助呀,我有一个juniper SRX650,junos,在做静态NAT时遇到一个IP回流的问题,请各位帮忙啦,我的问题如下:
我有一个公网地址是211.147.75.196(该公网地址不是用来给用户上网使用的),私网地址是10.10.8.2,所开放的端口是443和80,我现在遇到的问题是在做完相应的设置后,我发现外部环境网络环境都可以访问https://211.147.75.196,但是在我的局域内部却无法访问这个网址,如果我使用https://10.10.8.2却是可以访问的,不知道还需要添加那些设置
      我的配置如下

1、做静态NAT
set security nat static rule-set static-nat from zone untrust
set security nat static rule-set static-nat rule rule10 match destination-address 211.147.75.196/32
set security nat static rule-set static-nat rule rule10 then static-nat prefix 10.10.8.2/32
set security nat proxy-arp interface ge-0/0/0.0 address 211.147.75.196/32
2、定义策略,从trust-untrust
set security policies from-zone trust to-zone untrust policy trust-untrust match destination-address any
3、定义策略,从untrust到trust
set security zones security-zone trust address-book address F5-WEB 10.10.8.2/32
set security policies from-zone untrust to-zone trust policy F5 match destination-address F5-WEB
set security policies from-zone untrust to-zone trust policy F5 match source-address any
set security policies from-zone untrust to-zone trust policy F5 match application f5-service
set security policies from-zone untrust to-zone trust policy F5 match application f5-service-443
set security policies from-zone untrust to-zone trust policy F5 then permit
4、定义所需要的端口
set applications application f5-service protocol tcp
set applications application f5-service source-port 1-65535
set applications application f5-service destination-port 80
set applications application f5-service-443 protocol tcp
set applications application f5-service-443 source-port 1-65535
set applications application f5-service-443 destination-port 443

查了一些资料,cisco有cisco的解决办法,虽然juniper思路略同,但操作起来确是天壤之别,查了很多资料都未解决,请有这方面经验或者相关资料的兄弟给点建议或者网址吧,先谢过了

发表于 2012-7-10 14:52:18 | 显示全部楼层
本帖最后由 Jeff. 于 2012-7-10 14:54 编辑

解决方案:
问题描述:

在实现Destination NAT的时候,如果需要从内网访问映射后的公网地址,默认会有一些问题,在内网可以ping 通映射地址,但是不能访问服务;


问题分析:


[edit security]

set zones security-zone trust address-book address server-2 192.168.1.200/32

[edit security policies from-zone untrust to-zone trust]

set policy server-access match source-address any destination-address server-2 application any

set policy server-access then permit

[edit security nat destination]

set pool dst-nat-pool-2 address 192.168.1.200 port 8000

set rule-set rs1 from zone untrust

set rule-set rs1 rule r2 match destination-address 1.1.1.101

set rule-set rs1 rule r2 match destination-port 80

set rule-set rs1 rule r2 then destination-nat pool dst-nat-pool-2

[edit security nat]

set proxy-arp interface ge-0/0/2.0 address 1.1.1.101

一般的我们如上配置完设备后,外网用户便可以访问映射地址了,但是如果内网用户访问会有问题,不能通过1.1.1.101访问服务;

原因是内部地址访问1.1.1.101的时候,防火墙不做地址转换,将内网地址路由给目的服务器,服务器会看到这个地址,回包的时候直接把数据包回给这个内网地址,TCP形成一个半连接,故服务不能访问。



解决办法:

来自信任区域的访问也做一次destination nat,需要添加以下命令


[edit security nat destination]

set rule-set rs1 from zone trust

set rule-set rs1 rule r2 match destination-address 1.1.1.101

set rule-set rs1 rule r2 match destination-port 80

set rule-set rs1 rule r2 then destination-nat pool dst-nat-pool-2

希望能解决你的问题。


发表于 2012-7-10 14:56:34 | 显示全部楼层
本帖最后由 victor_huang 于 2012-7-10 15:08 编辑

传2个资料给楼主看看吧,一个是Juniper 防火墙的,一个是PIX防火墙的,记得ASA解决上述问题也是用的alias。
ASA

Using the Alias Command for DNS Rewrite

    The alias command causes the ASA to translate addresses on an IP network residing on any interface into addresses on another IP network connected through a different interface. The syntax for this command is as follows:

    hostname(config)# alias (interface_name) mapped-address real-address

    The following example specifies that the real address (192.168.100.10) on any interface except the inside interface will be translated to the mapped address (209.165.200.225) on the inside interface. Notice that the location of 192.168.100.10 is not precisely defined.

    hostname(config)# alias (inside) 209.165.200.225 192.168.100.10

Note:If you use the alias command to configure DNS Rewrite, proxy ARP will be performed for the mapped address. To prevent this, disable Proxy ARP by entering the sysopt noproxyarp command after entering the alias command.


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
 楼主| 发表于 2012-7-10 22:08:59 | 显示全部楼层
Jeff. 发表于 2012-7-10 14:52
解决方案:
问题描述:

谢谢jeff的帮助,非常感谢
 楼主| 发表于 2012-7-10 22:10:19 | 显示全部楼层
victor_huang 发表于 2012-7-10 14:56
传2个资料给楼主看看吧,一个是Juniper 防火墙的,一个是PIX防火墙的,记得ASA解决上述问题也是用的alias。 ...

也很感谢victor_huang,这些资料我之前都已做过相应的偿试,但仍然要感谢您的无私支持
 楼主| 发表于 2012-7-10 22:27:27 | 显示全部楼层
问题已解决,对于这个回流问题,cisco有cisco的解决办法,大家都是cisco高手,我就不敢在这里多嘴多舌了。对于juniper来说,尤其是junos,感觉上不管从命令,还是到理论都要比screen os复杂一些。今天在juniper原厂工程师的帮助下这个问题得以解决
我这几天一直在为这个问题来回的转圈,我一直是纠结在了NAT方面的配置,从而忽略了policy方面的一些配置,因为网上大多数资料都是在围绕NAT上面做文章,所以就信了别人的结论。今天经juniper工程师点拔了一下,听那个老外在电话里叽叽咕咕的唠叨了半天,终于就懂了二句:
1、trust to trust
2、nat from trust
连蒙带猜的试着做了一下,竟然成功了,理论到目前为止也没能想明白,但事实就是如此,它就是通了:大概是这样的,默认在做静态NAT,做一对一映射时,我的区域选择的是untrust,这个我能很明白理解,但是让我不能理解的是接下来还要在做一遍静态NAT,这次选择的区域是trust;也就是二楼三楼兄弟文章里的一句话“来自信任区域的访问也做一次NAT”;如果单这样做是无法成功的,接下来,还需要在做策略时在加上一条trust到trust的策略,在这条策略里面进行匹配相应的源、目的地址、服务等,总的来说,增加了如下操作
从trust的NAT
set security nat static rule-set static-nat-trust from zone trust
set security nat static rule-set static-nat-trust rule rule2-10 match destination-address 211.147.75.196/32
set security nat static rule-set static-nat-trust rule rule2-10 then static-nat prefix 10.10.8.2/32
从trust到trust的策略
set security policies from-zone trust to-zone trust policy trust-to-trust match source-address any
set security policies from-zone trust to-zone trust policy trust-to-trust match destination-address F5-WEB
set security policies from-zone trust to-zone trust policy trust-to-trust match application f5-service
set security policies from-zone trust to-zone trust policy trust-to-trust match application f5-service-443
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )

GMT+8, 2024-5-19 06:36 , Processed in 0.078174 second(s), 19 queries , Gzip On.

快速回复 返回顶部 返回列表