SRX Services Gateway
Reply
Contributor
CARD IT
Posts: 10
Registered: ‎07-25-2010
0
Accepted Solution

Cannot access websites from located on trust zone internally

Hi,

 

I have setup a static nat for my webservers in the trust zone. I can access the websites just fine from outside of the network but i cannot access the websites from inside.

 

I have setup the proxy-arp, rule-set rules in static nat and policy from untrust to trust to allow the traffic.

 

Thanks.

pkc
Contributor
pkc
Posts: 111
Registered: ‎09-24-2008
0

Re: Cannot access websites from located on trust zone internally

Hi,

 

To which zone belong the inside ?

 

did you try to run debug flow ?

(set security flow traceoptions ...)

Contributor
CARD IT
Posts: 10
Registered: ‎07-25-2010
0

Re: Cannot access websites from located on trust zone internally

Inside = Trust Zone.

 

Yes, I did try to run debug flow. I'm having a hard time interpreting it as i am new with this stuff. I ahve attached a copy of the flow-trace.

 

Here are parts of my config file that relates to the issue. Is there anything else im missing to get the static nat working from my trust zone? I have read about the "from-zone untrust to-zone junos-global" config but i couldn't figure out how to format the "static_nat_ip " destination address.

 

ge-0/0/0 {
        unit 0 {
            description "WAN port";
            proxy-arp;
            family inet {
                address <wan ip>;
            }

 

 nat {
        source {
            rule-set trust-to-untrust {
                from zone trust;
                to zone untrust;
                rule source-nat-rule {
                    match {
                        source-address 0.0.0.0/0;
                    }
                    then {
                        source-nat {
                            interface;
                        }
                    }
                }
            }
        }
        static {
            rule-set static-nat {
                from zone untrust;
               rule my_website{
                    match {
                        destination-address <dedicated public ip for this website>/32;
                    }
                    then {
                        static-nat prefix 172.16.0.202/32; //private ip of my webserver.
                    }
                }
 

proxy-arp {
            interface ge-0/0/0.0 {
                address {
                    <dedicated public ip for this website>/32;

}

}

 

 

 policies {
        from-zone trust to-zone untrust {
            policy trust-to-untrust {
                match {
                    source-address any;
                    destination-address any;
                    application any;
                }
                then {
                    permit;
                }
            }
        }
        from-zone untrust to-zone trust {
            policy aubreyallowall {
                match {
                    source-address any;
                    destination-address aubrey;
                    application any;
                }
                then {
                    permit;
                }
            }
           
            policy allow_web {
                match {
                    source-address any;
                destination-address web_servers;
                    application [ junos-http junos-https ];
                }
                then {
                    permit;
                }
            }



 

Visitor
Kinshuk
Posts: 6
Registered: ‎03-20-2010

Re: Cannot access websites from located on trust zone internally

Greetings!

 

The reason is simple!

The static NAT rule does not match the traffic generated from your Inside (or trust) zone. Your static rule matches traffic from untrust zone and any traffic from untrust zone gets natted and you are able to reach the internet.

 

In order to be able to reach the webserver from untrust and trust zone using the same Public IP address you will need to configure the following:

 

1. Static NAT rule:

static {
            rule-set static-nat {
                from routing-instance default;
               rule my_website{
                    match {
                        destination-address <dedicated public ip for this website>/32;
                    }
                    then {
                        static-nat prefix 172.16.0.202/32; //private ip of my webserver.
                    }
                }

 

This matches any traffic coming in from default routing instance.

 

2. Apply proxy arp or have the devices in trust zone point there default gateway towards the SRX internal (trust) IP so that packets reach the SRX

 

3. Change the source IP of the traffic.

 nat {
        source {
            rule-set trust-to-trust {
                from zone trust;
                to zone trust;
                rule source-nat-rule {
                    match {
                        source-address 0.0.0.0/0;
                    }
                    then {
                        source-nat {
                            interface;
                        }
                    }
                }
            }
        }

 

Without the third step, after the packet's destination address gets NAT'ed and it reaches the webserver, the source address remains unchanged and in most cases can belong to same subnet as that of webserver (private) ip. If thats the case the web server will try to get MAC of that IP by sending ARPs instead of sending the reply packet back to SRX which will never work.

 

Hope this helps!

 

Regards,

 

Kinshuk

 

Regards,

Kinshuk Chakladar (JNCIS-SEC JNCIS-ER)
Visitor
Kinshuk
Posts: 6
Registered: ‎03-20-2010
0

Re: Cannot access websites from located on trust zone internally

 

Please do remember to create a security policy from zone trust to zone trust and permit the same.

Regards,

Kinshuk Chakladar (JNCIS-SEC JNCIS-ER)
Contributor
CARD IT
Posts: 10
Registered: ‎07-25-2010
0

Re: Cannot access websites from located on trust zone internally

it worked. thank you for explaining it to me as well instead of just giving me what to type.

Copyright© 1999-2013 Juniper Networks, Inc. All rights reserved.