home

Supported platforms

Vyatta documentation

Learn how to install, configure, and operate the Vyatta Network Operating System (Vyatta NOS) and Orchestrator, which help drive our virtual networking and physical platforms portfolio.

Address and port groups

The following example shows how to configure address groups and applying NAT rules to them.

Table 1. Configuring address groups and applying NAT rules

Step

Command

Configure address and port to join a group named foo.

vyatta@vyatta# set resources group port-group bar port 1
vyatta@vyatta# set resources group port-group bar port 121
vyatta@vyatta# commit
vyatta@vyatta# show resources
resources {
        group {
                address-group foo {
                        address 1.1.1.0/24
                        address 2.2.0.0/16
                        address 12.32.223.3
                }
                port-group bar {
                        port 1
                        port 121
                                }
        }
}

Create a source NAT rule.

vyatta@vyatta# set service nat source rule 200 source address foo
vyatta@vyatta# set service nat source rule 200 source port bar
vyatta@vyatta# set service nat source rule 200 protocol tcp
vyatta@vyatta# set service nat source rule 200 translation address 20.20.10.0/24
vyatta@vyatta# set service nat source rule 200 translation port http
vyatta@vyatta# set service nat source rule 200 outbound-interface dp0s224

Commit the changes.

vyatta@vyatta# commit

Show the NAT configuration.

vyatta@vyatta# show service nat source rule 200
outbound-interface dp0s224
protocol tcp
source {
        address foo
        port bar
}
translation {
        address 20.20.10.0/24
        port http
}