.. _example_interfaces_ethernet_traffic_nat_dnat:
####
Dnat
####
.. sidebar:: Contents
.. contents::
:depth: 2
:local:
These scenarios show how to configure DNAT (Destination Network
Address Translation) on OSDx.
.. image:: dnat.svg
:width: 400
*********
Test DNAT
*********
Description
===========
In this scenario, DUT0 modifies the destination
address of incoming packets generated at the WAN
side. The address is translated to a custom one:
``192.168.100.2``.
Scenario
========
.. include:: dnat/testdnat
.. raw:: html
******************
Test DNAT Redirect
******************
Description
===========
This scenario is similar to the previous one, but
when redirect is specified the destination address
is NATed to the interface IP.
Scenario
========
.. include:: dnat/testdnatredirect
.. raw:: html
*************************
Test DNAT Port Forwarding
*************************
Description
===========
In this scenario, DNAT forwards incoming TCP
traffic destined to a specific port. Requests
arriving at ``10.0.0.2:80`` are translated to
``192.168.100.2:8080``.
Scenario
========
.. include:: dnat/testdnatportforwarding
.. raw:: html
**********************
Test DNAT Address Pool
**********************
Description
===========
In this scenario, DNAT translates the destination
of incoming packets to one address from a pool.
The kernel selects the target address per
connection.
Scenario
========
.. include:: dnat/testdnataddresspool
.. raw:: html
************************
Test DNAT Network Prefix
************************
Description
===========
In this scenario, DNAT translates the destination
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:: dnat/testdnatnetworkprefix
.. raw:: html