Deploying Cisco traffic generator in GNS3

Goal: Deploy TRex, a realistic Cisco traffic generator, to test devices in GNS3.

TRex traffic generator is a tool designed to benchmark platforms using realistic traffic.
One of the tools through which TRex can be learned and tested is a virtual machine instance, fully simulating TRex without the need for any additional hardware.

The TRex Virtual Machine is based on Oracle’s Virtual Box freeware.
It is designed to enable TRex newbies to explore this tool without any special resources.

Download the virtual appliance ova file:

Open the image in VMWare (I am using VMWare workstation)

From GNS3 import the VMWare device:

Edit the VM template and make sure to select “Allow GNS3 to use any configured VMware adapter”


Insert the a device to test, DUT (Device Under Test), in our case it is a Cisco IOU router and build the following topology, in which TRex will play the role of the client and the server for the generated traffic.



Because TRex doesn’t implement ARP, we have to manually indicate the router MAC addresses of the directly connected interfaces.
You can set TRex to match the DUT MACs or DUT to match the default MAC configured on TRex. We opt for the first solution:

Note the router interface MAC addresses:


Login to TRex through the console:

  • Username: trex
  • Password: trex

and edit Trex configuration file


and change the DUT MACs

Screenshot - 260716 - 23:33:48

Make sure the list of interfaces ids match the ones defined by

cd v1.62

sudo ./ –status


We also need to set our router under test with the MAC addersses used by TRex for the traffic.

On the IOU router:

IOU1(config-if)#int e0/0
IOU1(config-if)#ip address
IOU1(config-if)#du fu
IOU1(config-if)#no sh
IOU1(config-if)#int e0/1
IOU1(config-if)#ip address
IOU1(config-if)#du fu
IOU1(config-if)#no sh

IOU1(config)#arp  0800.2723.21dc ARPA
IOU1(config)#arp  0800.2723.21dd ARPA
IOU1(config)#do sh arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet            –   0800.2723.21dc  ARPA
Internet            –   0800.2723.21dd  ARPA

e0/1 and e0/2 IP addresses are configured with and In fact it doesn’t matter for TRex because we have routes to forward traffic out the appropriate interfaces to reach TRex interfaces.

On the router set routes to the emulated client and servers:

ip route
ip route

For this lab we will generate IMIX traffic (64byte UDP packets profile) from emulated clients and servers using virtual IP range configurable in 16.0.0.[1-255] and 48.0.[0.1-255.255]

Back to TRex:



So let’s configure our router to route traffic destined to previous ranges out the appropriate interfaces.

IOU router:

IOU1(config)#ip route
IOU1(config)#ip route

Start the emulation on Trex:

sudo ./t-rex-64 -f cap2/imix_64.yaml  -d 60 -m 40000  -c 1


You can observe the generated traffic passing through the router with Wireshark


For more inf. please refer to



About ajnouri
Se vi deziras sekure komuniki eksterbloge, jen mia publika (GPG) ŝlosilo: My public key for secure communication:

9 Responses to Deploying Cisco traffic generator in GNS3

  1. Yaroslav Brustinov says:


    Seems you have an error in /etc/trex_cfg.yaml
    The MAC of router [0xAA,0xBB,0xCC,0x00,0x01,0x00] should be dest_mac.


  2. ajnouri says:

    Hi Yaroslav,
    Indeed router MAC addresses are on dest_mac.
    Corrected the corresponding image.


  3. Dhruv says:

    Please share the TRex Machine Login and Password …


  4. Pingback: Confluence: [ODC] Xian ODC

  5. can we use any other router other than iou routers?
    please reply fast.

  6. Priya says:


    I tried to download the ova file from the link provided. But unfortunately the link is down and see the below error.
    Gateway Timeout
    Server error – server is unreachable at this moment.

    Please retry the request or contact your administrator.

    Could you please let me the link where i can download Trex OVA file


  7. Sam Tan says:

    I also need to download a working voa, because for 4 months (not full time) I been trying to build from ground up, faced so many issues after issues

    Hence looking for a fully working VM to test it

    Please help

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: