[ Contents] [ Prev] [ Next] [ Index] [ Report an Error]

Applying NAT to an Interface

To enable the NAT services on an interface, you assign the defined NAT rules to a service set and apply the service set to an interface. For more information about applying services to an interface, see the JUNOS Services Interfaces Configuration Guide.

You enable NAT services on an interface as follows:

To apply NAT to an interface:

  1. Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
  2. Perform the configuration tasks described in Table 93.
  3. If you are finished configuring the router, commit the configuration.
  4. To verify NAT, see Verifying NAT Configuration.

Table 93: Applying NAT to an Interface

Task

J-Web Configuration Editor

CLI Configuration Editor

Navigate to the Services level in the configuration hierarchy.

  1. In the J-Web interface, select Configuration>View and Edit>Edit Configuration.
  2. Next to Services, click Configure or Edit.

From the [edit] hierarchy level, enter

edit services

Define a service set—for example, nat-service-set.

Assign the defined NAT rule to the service set—for example, nat-rule.

  1. Next to Service set, click Add new entry.
  2. In the Service set name box, type nat-service-set.
  3. From the Nat rules choice list, select Nat rules.
  4. Next to Nat rules, click Add new entry.
  5. In the Rule name box, type the name of the defined NAT rule—for example, nat-rule.
  6. Click OK.

Set the service set and assign the NAT rule to it:

set service-set service-set-name nat-rules nat-rule-name

Define a service set type and virtual service interface sp-0/0/0 as the service interface for nat-service-set.

  1. From the Service type choice list, select Interface service.
  2. Next to Interface service, click Configure.
  3. In the Service interface box, type sp-0/0/0.
  4. Click OK.

Define the service set type and the service interface:

set service-set nat-rule-set interface-service service-interface sp-0/0/0

Navigate to the Interfaces level in the configuration hierarchy.

On the main Configuration page next to Interfaces, click Configure or Edit.

From the [edit] hierarchy level, enter

edit interface

Configure the sp-0/0/0 service interface.

(See the interface naming conventions in the J-series Services Router Basic LAN and WAN Access Configuration Guide.)

  1. Next to Interface, click Add new entry.
  2. In the Interface name box, type sp-0/0/0.
  3. Click OK.
  4. Click sp-0/0/0.
  5. Next to Unit, click Add new entry.
  6. In the Interface unit number box, type 0.
  7. Next to Inet, select the check box.
  8. Click OK.

Set the service interface:

set interfaces sp-0/0/0 unit 0 family inet

Apply nat-service-set to the input and output sides of the physical interface on which NAT is to be enabled—for example t1–0/0/0.

  1. On the main Configuration page next to Interfaces, click Edit.
  2. Under Interface name, click t1–0/0/0.
  3. Under Interface unit number, click 0.
  4. Under Family, make sure the Inet check box is selected, and click Configure or Edit.
  5. Next to Service, click Configure.
  6. Next to Input, click Configure.
  7. Next to Service set, click Add new entry.
  8. In the Service set name box, type nat-service-set.
  9. Click OK twice.
  10. Next to Output, click Configure.
  11. Next to Service set, click Add new entry.
  12. In the Service set name box, type nat-service-set.
  13. Click OK.

From the [edit] hierarchy level, apply the service set to the interface:

set interfaces t1–0/0/0 unit 0 family inet service input service-set nat-service-set

set interfaces t1–0/0/0 unit 0 family inet service output service-set nat-service-set


[ Contents] [ Prev] [ Next] [ Index] [ Report an Error]