[j-nsp] Help with NAT configuration

Tom Storey tom at snnap.net
Sat Jul 18 08:36:20 EDT 2009


Im sure this question has been asked before, but googling and reading  
examples and the JUNOS documentation has not yeilded an answer yet.

I have a classic network example whereby my WAN IP address is  
dynamically assigned, but every configuration example I have seen  
specifically states the WAN IP address [range] to use for NAT.

Is there anyway I can simply say "I dont know what address to use, use  
whatever is assigned to interface x"? Specifically I would like to  
tell it to use which ever address is assigned to pp0.0.

Below is the config I wish to apply, but Ive yet to solve the above  
before I can commit it (complains about the lack of address in the  
pool). Ive been playing around, so please correct me on any mistakes  
Ive made.

Any help greatly appreciated! :-)

   services {
       service-set wan-service-set {
           nat-rules nat-egress;
           nat-rules nat-ingress;
           interface-service {
               service-interface sp-0/0/0;
           }
       }
       nat {
           pool nat-pool {
               port automatic;
           }
           rule nat-egress {
               match-direction output;
               term 1 {
                   then {
                       translated {
                           source-pool nat-pool;
                           translation-type {
                               source dynamic;
                           }
                       }
                   }
               }
           }
           rule nat-ingress {
               match-direction input;
               term other {
                   from {
                       destination-address {
                           any-unicast;
                       }
                   }
                   then {
                       no-translation;
                   }
               }
           }
       }
   }



More information about the juniper-nsp mailing list