Vyatta NOS documentation

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

The "source" filter

The source filter specifies the packets to which NAT applies based on their source address, port, or both. NAT applies only to packets that have a source address, port, or both that match that defined in the filter.

If the source filter is not specified, then by default, the rule matches packets arriving from any source address and port. The source filter can be used in SNAT and DNAT rules.

Filtering packets by source address

The following example shows how to apply a SNAT rule, rule 10, to packets with a source address of 10.0.0.4. Only packets with a source address of 10.0.0.4 have address translation performed.

vyatta@vyatta# set service nat source rule 10 source address 10.0.0.4

Filtering packets by source network address and port

The following example shows how to apply a SNAT rule, rule 20, to packets with a source network of 10.0.0.0/24 and a port of 80. Only packets with a source address on the 10.0.0.0/24 subnet with a source port of 80 have address translation performed.

vyatta@vyatta# set service nat source rule 20 source address 10.0.0.0/24

vyatta@vyatta# set service nat source rule 20 source port 80