Cleaning up my home directory, I found this presentation I made back in 2006 while beta-testing the policy based routing functionality in netscreen firewalls.
Posting it here as it might be of use to some people.
Just curious if PBR can help conserve the interface address when dealing with a limited Internet IP situation. For example, I've moved away from interface based NAT toward policy based NAT, however the one thing I loved about interface NAT is the ability to utilize the untrust interface IP as a VIP and perform "port forwarding" using the actual interface IP as well as additional VIPs. In a situation where I'm cramming a ton of services on to a 5 IP subnet, this was most helpful.
Obviously the problem I have with policy based nat is the route portion, which using routing tables alone means the route for the untrust interface IP is already set and routed to the untrust interface. Since PBR policies are processed before the standard routing table is checked, could I route traffic bound for the untrust interface IP address based on port/protocol? For instance, could I take traffic bound for port 80 on the untrust interface IP and route it to the trust zone using a policy? This is something I cannot do with policy based NAT and the standard routing tables alone.
If possibly, could you walk me through an example of the ACL and group setups required to do this? Thanks very much!
I never tried redirecting traffic destined to the firewall itself using PBR, but is it really necessary? You could create a policy from untrust to untrust and then destination-NAT it to whatever internal IP you want. The destination IP doesn't even have to be in the same zone, it will still work.
It looks a bit ugly because its going back to the untrust zone, but its no different from VIP/MIP which also ignore the zones (the rules all end up in the global zone).
Hmm I seem to be having a problem creating an intra-zone policy that works. Does the "Block Intra-Zone Traffic" checkbox (yes, I'm a GUI loser) have to be checked or unchecked to allow intra-zone policies to work, or is it irrelevant?
Are you available for consulting? I have a complex setup (I think it's complex anyway) that I need some serious help on. It's a non-production setup so it's safe to tinker on, I just need some assistance grasping some concepts and figuring out a config that will work for what we're trying to do.
Upon further testing, it seems our SSG20 will not properly translate traffic bound for the firewall interface IP. I removed all routes and inter-zone destination-nat policies in favor of creating intra-zone policies on the untrust zone instead. The policies work for every IP in the subnet except the interface IP. Apparently there is some limitation or perhaps a special config setting unique to the interface IP that I'm missing?
The interface IP is of course special and from a quick test I ran, you can't get around that using PBR either. The only way that I know of is to use a VIP.
Is there a reason why you aren't using a VIP? Recent ScreenOS versions have removed some of the limitations that existed before (although there still are quite some).
Especially for the interface address itself, I think thats the only option.
The primary limitations I'm concerned with with VIP are 1) the limited number of VIPs that can be setup, and the limited number of "port forwards" you can setup. 2) SIP through VIP is DOA (just had to use a 3rd acronym there).
I thought I had things all figured out with intra-zone dest-nat policies until I started noticing odd behavior. Some of the policies worked, while others flat out would not. Sometimes none of them would work unless, and this is very odd, I added a VIP. Then they would work, and continue working even if I then removed the VIP.
It got so bad I posted on eLance asking for professional assistance. I've got one taker so hopefully we'll see what I did wrong.
If the destination addresses which you are trying to map to internal devices, are in the same range as your external interface IP, you'll have to enter the command "set arp nat-dst" in CLI so that the netscreen will respond to ARP requests for that address.
The other alternative would be to create a DIP/DIP in parallel. As you already observed, creating a VIP will cause things to magically work. This was most likely because then the netscreen responded to ARPs, which were subsequently cached by the upstream router. A few hours later that would stop working again though.
This command is a deprecated command, please use the following new preferred syntax:
set interface proxy-arp-entry [ip_max]
However after reading the KB article I think I'm going to stick with creating a DIP range. The funny thing is when I tried working with VIPs I also tried creating a DIP range and it didn't seem to work correctly, but who knows with ARP caching how long it might take for upstream routers to latch on to the new MAC. Maybe I was impatient.
I suppose I could also coordinate with my upstream provider to flush the ARP cache on their box after I perform the switch-over to the new SSG20 (I'm currently running a 5GT).
Well, the interface proxy arp setting appears to be doing the trick with the new public subnet. Once I get the time to attempt a swap-out of our 5GT for the SSG 20 again, I'll set proxy arp entries for the current production subnet and send an update.
Comments
Daniel
Fri, 01/07/2011 - 10:56
Permalink
Thanks for the tip about
Thanks for the tip about "Bypassing PBR"!
amal
Mon, 03/28/2011 - 21:00
Permalink
Just curious if PBR can help
Just curious if PBR can help conserve the interface address when dealing with a limited Internet IP situation. For example, I've moved away from interface based NAT toward policy based NAT, however the one thing I loved about interface NAT is the ability to utilize the untrust interface IP as a VIP and perform "port forwarding" using the actual interface IP as well as additional VIPs. In a situation where I'm cramming a ton of services on to a 5 IP subnet, this was most helpful.
Obviously the problem I have with policy based nat is the route portion, which using routing tables alone means the route for the untrust interface IP is already set and routed to the untrust interface. Since PBR policies are processed before the standard routing table is checked, could I route traffic bound for the untrust interface IP address based on port/protocol? For instance, could I take traffic bound for port 80 on the untrust interface IP and route it to the trust zone using a policy? This is something I cannot do with policy based NAT and the standard routing tables alone.
If possibly, could you walk me through an example of the ACL and group setups required to do this? Thanks very much!
Bart
Mon, 03/28/2011 - 21:12
Permalink
I never tried redirecting
I never tried redirecting traffic destined to the firewall itself using PBR, but is it really necessary? You could create a policy from untrust to untrust and then destination-NAT it to whatever internal IP you want. The destination IP doesn't even have to be in the same zone, it will still work.
It looks a bit ugly because its going back to the untrust zone, but its no different from VIP/MIP which also ignore the zones (the rules all end up in the global zone).
amal
Mon, 03/28/2011 - 21:49
Permalink
Hmm I seem to be having a
Hmm I seem to be having a problem creating an intra-zone policy that works. Does the "Block Intra-Zone Traffic" checkbox (yes, I'm a GUI loser) have to be checked or unchecked to allow intra-zone policies to work, or is it irrelevant?
Are you available for consulting? I have a complex setup (I think it's complex anyway) that I need some serious help on. It's a non-production setup so it's safe to tinker on, I just need some assistance grasping some concepts and figuring out a config that will work for what we're trying to do.
amal
Mon, 03/28/2011 - 23:36
Permalink
Upon further testing, it
Upon further testing, it seems our SSG20 will not properly translate traffic bound for the firewall interface IP. I removed all routes and inter-zone destination-nat policies in favor of creating intra-zone policies on the untrust zone instead. The policies work for every IP in the subnet except the interface IP. Apparently there is some limitation or perhaps a special config setting unique to the interface IP that I'm missing?
Bart
Wed, 03/30/2011 - 20:20
Permalink
The interface IP is of course
The interface IP is of course special and from a quick test I ran, you can't get around that using PBR either. The only way that I know of is to use a VIP.
Is there a reason why you aren't using a VIP? Recent ScreenOS versions have removed some of the limitations that existed before (although there still are quite some).
Especially for the interface address itself, I think thats the only option.
amal
Thu, 03/31/2011 - 23:55
Permalink
The primary limitations I'm
The primary limitations I'm concerned with with VIP are 1) the limited number of VIPs that can be setup, and the limited number of "port forwards" you can setup. 2) SIP through VIP is DOA (just had to use a 3rd acronym there).
I thought I had things all figured out with intra-zone dest-nat policies until I started noticing odd behavior. Some of the policies worked, while others flat out would not. Sometimes none of them would work unless, and this is very odd, I added a VIP. Then they would work, and continue working even if I then removed the VIP.
It got so bad I posted on eLance asking for professional assistance. I've got one taker so hopefully we'll see what I did wrong.
Bart
Sun, 04/03/2011 - 20:23
Permalink
If the destination addresses
If the destination addresses which you are trying to map to internal devices, are in the same range as your external interface IP, you'll have to enter the command "set arp nat-dst" in CLI so that the netscreen will respond to ARP requests for that address.
The other alternative would be to create a DIP/DIP in parallel. As you already observed, creating a VIP will cause things to magically work. This was most likely because then the netscreen responded to ARPs, which were subsequently cached by the upstream router. A few hours later that would stop working again though.
Some more details about that: http://kb.juniper.net/InfoCenter/index?page=content&id=KB10174
amal
Wed, 04/06/2011 - 01:07
Permalink
Ahh very interesting. I
Ahh very interesting. I figured there was something I was missing. I'll give it a go and let you know!
amal
Wed, 04/06/2011 - 01:13
Permalink
My ScreenOS responds to the
My ScreenOS responds to the command with:
This command is a deprecated command, please use the following new preferred syntax:
set interface proxy-arp-entry [ip_max]
However after reading the KB article I think I'm going to stick with creating a DIP range. The funny thing is when I tried working with VIPs I also tried creating a DIP range and it didn't seem to work correctly, but who knows with ARP caching how long it might take for upstream routers to latch on to the new MAC. Maybe I was impatient.
I suppose I could also coordinate with my upstream provider to flush the ARP cache on their box after I perform the switch-over to the new SSG20 (I'm currently running a 5GT).
I'll give it a shot and let you know.
amal
Wed, 04/06/2011 - 02:47
Permalink
Well, the interface proxy arp
Well, the interface proxy arp setting appears to be doing the trick with the new public subnet. Once I get the time to attempt a swap-out of our 5GT for the SSG 20 again, I'll set proxy arp entries for the current production subnet and send an update.
Add new comment