TRex first time configuration

hhaim with the Help of Amir Kroparo. New rev fixes by Ido Barnea.

2014-11-01

General info

Setup description

images/trex-asr-setup.png
Figure 1. TRex/Router setup

Not supported setup description

images/trex-not-supported-setup.png
Figure 2. Not supported setup

TRex configuration

 - port_limit      : 2
    port_info       :
    - default_gw      : 11.11.11.1 #<1>
      ip              : 11.11.11.2 #<2>
    - default_gw      : 12.12.12.1 #<3>
      ip              : 12.12.12.2 #<4>
  1. TRex port 0 config- should be router’s TenG 0/0/0 IP. TRex will try to resolve this address by sending ARP request.

  2. Next hop of router’s TenG 0/0/0. TRex will send gratuitous ARP for this address.

  3. TRex port 1 config- should be router’s TenG 0/0/1 IP. TRex will try to resolve this address by sending ARP request.

  4. Next hop of router’s TenG 0/0/0. TRex will send gratuitous ARP for this address.

TRex emulated server/client IPs definition in traffic config file

generator :
  distribution : "seq"
  clients_start : "16.0.0.1"
  clients_end   : "16.0.0.255"
  servers_start : "48.0.0.1"
  servers_end   : "48.0.0.240"

Router config. Option 1 - static routes

interface TenGigabitEthernet0/0/0
 ip address 11.11.11.1 255.255.255.0
!
`
interface TenGigabitEthernet0/0/1
 ip address 12.12.12.1 255.255.255.0
!
ip route 16.0.0.0 255.0.0.0 11.11.11.2  <1>
ip route 48.0.0.0 255.0.0.0 12.12.12.2  <2>
  1. Route clients network to TRex server emulation interface.

  2. Route servers network to TRex client emulation interface.

Router config. Option 2 - PBR part 1

interface TenGigabitEthernet0/0/0
 ip address 11.11.11.1 255.255.255.0           <1>
 ip policy route-map p1_to_p2                   <2>
 load-interval 30
!

interface TenGigabitEthernet0/0/1
 ip address 12.12.12.1 255.255.255.0           <1>
 ip policy route-map p2_to_p1                   <2>
 load-interval 30
!
  1. Configure ip address for the port.

  2. Configure PBR policy - see next slide

Router config. Option 2 - PBR part 2


route-map p1_to_p2 permit 10
 set ip next-hop 12.12.12.2    <1>
!
route-map p2_to_p1 permit 10
 set ip next-hop 11.11.11.2    <2>
  1. Set the destination to be 12.12.12.2, in the subnet of TenG 0/0/1.

  2. Set the destination to be 11.11.11.2 , in the subnet to TenG 0/0/0.

Verify cable connections

$./t-rex-64 -f cap2/dns.yaml -m 1  -d 10  -l 1000 --lo --lm 1
$./t-rex-64 -f cap2/dns.yaml -m 1  -d 10  -l 1000 --lo --lm 2
$./t-rex-64 -f cap2/dns.yaml -m 1  -d 10  -l 1000

MAC based configuration

 - port_limit      : 2
    port_info       :  # set eh mac addr
    - dest_mac        :   [0x0,0x0,0x0,0x1,0x0,0x0]
      src_mac         :   [0x0,0x0,0x0,0x2,0x0,0x0]
    - dest_mac        :   [0x0,0x0,0x0,0x3,0x0,0x0]
      src_mac         :   [0x0,0x0,0x0,0x4,0x0,0x0]
  1. Should be Router’s TenG 0/0/0 mac-address.

  2. Router should be configured to send to this mac-address.

  3. Should be Router’s TenG 0/0/1 mac-address.

  4. Router should be configured to send to this mac-address.

 arp 11.11.11.2 0000.0002.0000 ARPA  #<1>
 arp 12.12.12.2 0000.0004.0000 ARPA  #<2>
  1. TRex port 0 source mac-address.

  2. TRex port 1 source mac-address.

Linux config

route add -net 48.0.0.0 netmask 255.0.0.0 gw 12.12.12.2
route add -net 16.0.0.0 netmask 255.0.0.0 gw 11.11.11.2
arp -s 11.11.11.2 00:00:00:02:00:00 #<1>
arp -s 12.12.12.2 00:00:00:04:00:00 #<2>
  1. TRex port 0 source mac-address.

  2. TRex port 1 source mac-address.

Static route configuration - IPV6

interface TenGigabitEthernet1/0/0
 ip address 11.11.11.1 255.255.255.0
 ip policy route-map p1_to_p2
 load-interval 30
 ipv6 enable                                                  #<1>
 ipv6 address 2001:DB8:1111:2222::1/64                        #<2>
 ipv6 policy route-map ipv6_p1_to_p2                          #<3>
!


ipv6 unicast-routing                                          #<4>

ipv6 neighbor 3001::2 TenGigabitEthernet0/1/0 0000.0002.0002  #<5>
ipv6 neighbor 2001::2 TenGigabitEthernet0/0/0 0000.0003.0002

route-map ipv6_p1_to_p2 permit 10                             #<6>
 set ipv6 next-hop 2001::2
!
route-map ipv6_p2_to_p1 permit 10
 set ipv6 next-hop 3001::2
!


csi-mcp-asr1k-40(config)#ipv6 route 4000::/64 2001::2
csi-mcp-asr1k-40(config)#ipv6 route 5000::/64 3001::2
  1. Enable ipv6

  2. Add ipv6 address

  3. Add pbr

  4. Enable ipv6 routing

  5. Mac-addr setting should be like TRex

  6. PBR configuraion

/