Table of Contents

1. Abstract

There are lots of Linux tutorials on the web, so this will not be full tutorial, only highlighting some key points. Commands were checked on Ubuntu system.

For this example:

  1. TRex Client side network is 16.0.0.x

  2. TRex Server side network is 48.0.0.x

  3. Linux Client side network eth0 is configured with IPv4 as

  4. Linux Server side network eth1 is configured with IPv4 as

  TRex-0 (> )   <-->

                ( [linux] -(

                <--> TRex-1 (<-

2. Enable forwarding

One time (will be discarded after reboot):

[bash]>echo 1 > /proc/sys/net/ipv4/ip_forward

To make this permanent, add the following line to the file /etc/sysctl.conf:


3. Add static routes

Example if for the default TRex networks, and

Routing all traffic from to the gateway

[cli]>route add -net netmask gw

Routing all traffic from to the gateway

[cli]>route add -net netmask gw

If you use stateless mode, and decide to add route only in one direction, remember to disable reverse path check.
For example, to disable on all interfaces:

for i in /proc/sys/net/ipv4/conf/*/rp_filter ; do
  echo 0 > $i

Alternatively, you can edit /etc/network/interfaces, and add something like this for both ports connected to TRex. This will take effect, only after restarting networking (rebooting the machine in an alternative also).

auto eth1
iface eth1 inet static
... same for

4. Add static ARP entries

[cli]>sudo arp -s <Second TRex port MAC>
[cli]>sudo arp -s <TRex side the NICs are not visible to ifconfig, run: