diff options
author | Ido Barnea <ibarnea@cisco.com> | 2016-11-03 13:35:08 +0200 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2016-11-03 13:35:08 +0200 |
commit | 4771db4649c8aadaea17dc2297a0366c4bd8d40e (patch) | |
tree | 3a96417becfd4bd60dc4ba5a6e582de7ed05a27d | |
parent | c36d0925c8e6cd4897281e88d1676dfc6c547b6e (diff) |
put back MAC based config to config presentation
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
-rwxr-xr-x | trex_book.asciidoc | 11 | ||||
-rwxr-xr-x | trex_config.asciidoc | 48 |
2 files changed, 54 insertions, 5 deletions
diff --git a/trex_book.asciidoc b/trex_book.asciidoc index 2ef342bf..2d35787a 100755 --- a/trex_book.asciidoc +++ b/trex_book.asciidoc @@ -1305,10 +1305,19 @@ the result as dest MAC. If no dest_mac given, and no ARP response received, TRex <11> Source MAC to use when sending packets from this interface. If not given (since version 2.10), MAC address of the port will be used. <12> If given (since version 2.10), TRex will issue gratitues ARP for the ip + src MAC pair on appropriate port. In stateful mode, -gratitues ARP for each ip will be sent every 120 seconds (Can be changed using --arp-refresh-period argument) +gratitues ARP for each ip will be sent every 120 seconds (Can be changed using --arp-refresh-period argument). <13> If given, gratitues ARP and ARP request will be sent using the given VLAN tag. <14> Old MAC address format. New format is supported since version v2.09. +[NOTE] +========================================================================================= +If you use version earlier than 2.10, or choose to omit the ``ip'' +and have mac based configuration, be aware that TRex will not send any +gratitues ARP and will not answer ARP requests. In this case, you must configure static +ARP entries pointing to TRex port on your DUT. For an example config, you can look +xref:trex_config[here]. +========================================================================================= + To find out which interfaces (NIC ports) can be used, perform the following: [source,bash] diff --git a/trex_config.asciidoc b/trex_config.asciidoc index ca68bbe7..5fc5a0fc 100755 --- a/trex_config.asciidoc +++ b/trex_config.asciidoc @@ -127,7 +127,9 @@ or use the default config file `/etc/trex_cfg.yaml` * Below is an example of how to configure TRex IP addresses. TRex will issue ARP for default_gw, and send gratuitous ARP for ip, on each port. This works, starting from TRex version 2.10. If you want to configure MAC addresses manually (equivalent to static -ARP), or running older TRex version, please see the full description of config file parameters in the manual. +ARP), or running older TRex version, information is available at the end of the presentation. +Full description of config file parameters can be found in the manual. + [source,python] ---- @@ -243,13 +245,51 @@ the switch to learn the MAC addresses of both sides. $./t-rex-64 -f cap2/dns.yaml -m 1 -d 10 -l 1000 ........................................... +== MAC based configuration + +* If you use TRex version older than 2.10, or wish to have MAC based configuration, TRex config +file must contain the following (instead of the ``ip'' and ``default_gw''). +[source,python] +---- + - port_limit : 2 + port_info : # set eh mac addr + - dest_mac : [0x0,0x0,0x0,0x1,0x0,0x0] <1> + src_mac : [0x0,0x0,0x0,0x2,0x0,0x0] <2> + - dest_mac : [0x0,0x0,0x0,0x3,0x0,0x0] <3> + src_mac : [0x0,0x0,0x0,0x4,0x0,0x0] <4> +---- +============================================================================= +. Should be Router's TenG 0/0/0 mac-address. +. Router should be configured to send to this mac-address. +. Should be Router's TenG 0/0/1 mac-address. +. Router should be configured to send to this mac-address. +============================================================================= + +* On the router side, you must add the following static ARP configuration. + +[source,python] +---- + arp 12.12.12.2 0000.0002.0000 ARPA <1> + arp 11.11.11.2 0000.0004.0000 ARPA <2> +---- +<1> TRex port 0 source mac-address. +<2> TRex port 1 source mac-address. + == Linux config * Assuming the same setup with Linux as DUT instead of the router, you can do the following. * Configure IPs of Linux interfaces to 12.12.12.1 and 11.11.11.1 -* 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 - +[source,python] +---- +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 +---- +* If you have MAC based TRex config, you should also add: +[source,python] +---- +arp -s 12.12.12.2 00:00:00:04:00:00 +arp -s 11.11.11.2 00:00:00:04:00:00 +---- == Static route configuration - IPV6 |