Add DNAT/SNAT support 97/1397/4
authorGene Snider <eugene.snider@huawei.com>
Tue, 1 Sep 2015 23:56:21 +0000 (16:56 -0700)
committerMaryam Tahhan <maryam.tahhan@intel.com>
Wed, 9 Sep 2015 08:08:36 +0000 (08:08 +0000)
commit72a6363bacadab1a0565ce71144471ba6f6d64ae
treed33466668c56ad4b28575dab2f826de9edeacf05
parent7278d39b3f86595539ee213e2e2b2b14e72f3ff8
Add DNAT/SNAT support

JIRA: VSPERF-72

This change adds optional IPv4 DNAT support to l2fwd module for level two
forwarding. With this change the l2fwd module can be used for testing
complex IP configuration routing with virtual switches.

Other L2 forwarding modules provide only Level 2 pass through. These can be
used for complex IP chain processing but rely on port forwarding in the switch.
With this module each packet which is forwarded optionally gets a new
destination IP and source masquerade. So a test packet can be routed to eth1
and forwarded on eth2 with a different target IP and source address.

To use this module compile it for your kernel and use the 'insmod' command
to insert it.

With no arguments this will forward eth1 to eth2 without modification.

With 'net1=ethX net2=ethX' Level 2 forwarding can be done between arbitrary
ports.

With 'netX=ethX,XX.XX.XX.XX,xx:xx:xx:xx:xx:xx' the packets which are forwarded
on the target port will be given the new destination IP and mac address. One
or both ports may enable DNAT.

Change-Id: If24281a6841930a7a85e4536da96b980ed48df1b
Signed-off-by: Gene Snider <eugene.snider@huawei.com>
Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com>
src/l2fwd/l2fwd.c