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.

Mapping of address ranges

The vRouter supports the mapping of an entire network of addresses to another network of addresses. This mapping means that you do not have to manually enter many NAT rules. For example, you can map the 10.0.0.0/24 network to the 11.22.33.0/24 network, which maps 10.0.0.1 through 11.22.33.1, 10.0.0.2 through 11.22.33.2, and so on. The networks must be the same size, that is, they must have the same network mask, as shown in the following figure.

Figure 1. Mapping of address ranges

To configure NAT in this way, perform the following steps in configuration mode.

Table 1. Mapping address ranges

Step

Command

Create SNAT rule 10.

vyatta@vyatta# set service nat source rule 10

Apply this rule to packets coming from any host on the 10.0.0.0/24 network and egressing through the dp0p1p1 interface.

vyatta@vyatta# set service nat source rule 10 source address 10.0.0.0/24 
vyatta@vyatta# set service nat source rule 10 outbound-interface dp0p1p1

Use 11.22.33.x as the source address in outgoing packets.

vyatta@vyatta# set service nat source rule 10 translation address 11.22.33.0/24

Create destination (DNAT) rule 10.

vyatta@vyatta# set service nat destination rule 10

Apply this rule to packets destined for any host on the 11.22.33.0/24 network and ingressing through the dp0p1p1 interface.

vyatta@vyatta# set service nat destination rule 10 destination address 11.22.33.0/24 
vyatta@vyatta# set service nat destination rule 10 inbound-interface dp0p1p1

Use 10.0.0.x as the destination address in incoming packets.

vyatta@vyatta# set service nat destination rule 10 translation address 10.0.0.0/24

Commit the change.

vyatta@vyatta# commit

Show the configuration.

vyatta@vyatta# show nat source rule 10
 outbound-interface dp0p1p1
 source {
     address 10.0.0.0/24
 }
 translation {
     address 11.22.33.0/24
 }
vyatta@vyatta# show nat destination rule 10
 destination {
     address 11.22.33.0/24
 }
 inbound-interface dp0p1p1
 translation {
     address 10.0.0.0/24
 }