.. _example_interfaces_ethernet_traffic_nat_snat:
####
Snat
####
.. sidebar:: Contents
.. contents::
:depth: 2
:local:
These scenarios show how to configure SNAT (Source Network
Address Translation) on OSDx.
.. image:: snat.svg
:width: 400
*********
Test SNAT
*********
Description
===========
In this scenario, DUT0 modifies the source address
of outgoing packets generated at the LAN side. The
address is translated to a custom one: ``10.0.0.1``.
Scenario
========
.. include:: snat/testsnat
.. raw:: html
********************
Test SNAT Masquerade
********************
Description
===========
This scenario is similar to the previous one, but
when masquerade is specified, the route uses the IP
address of the outgoing interface. Therefore,
masquerading should be configured if the outgoing
interface uses a dynamic IP address.
Scenario
========
.. include:: snat/testsnatmasquerade
.. raw:: html
*******************
Test SNAT Port Pool
*******************
Description
===========
In this scenario, the translation is performed using
masquerade with a pool of 3 ports. If at any time
there are 3 active connections, the next one will be
rejected.
Scenario
========
.. include:: snat/testsnatportpool
.. raw:: html
************************
Test SNAT Network Prefix
************************
Description
===========
In this scenario, the translation is performed using
a network prefix. The host part of the original IP
address is kept, but the network part is mangled
using a subnet prefix.
Scenario
========
.. include:: snat/testsnatnetworkprefix
.. raw:: html