Date created: Friday, August 18, 2023 9:33:53 AM. Last modified: Wednesday, March 26, 2025 5:37:06 PM
ethxmit
Example: https://www.youtube.com/watch?v=3q7X1kGdrtU
ethxmit is a tool to generate IP/TCP/UDP/ICMP/MPLS frames on EOS.
r2#bash
Arista Networks EOS shell
[r2 ~]$ ethxmit
Usage: ethxmit [ OPTIONS ] interface
ethxmit: error: expected output interface
[r2 ~]$ ethxmit --help
Usage: ethxmit [ OPTIONS ] interface
Options:
-h, --help show this help message and exit
-s SIZE, --size=SIZE packet size, including CRC (default: minimum possible
size, typically 64)
-S SMAC, --smac=SMAC source MAC address (default: use interface's MAC
address)
--incSmac=INCSMAC increment source mac repeating after N iterations (max
65535)
-D DMAC, --dmac=DMAC destination MAC address (default: ff:ff:ff:ff:ff:ff)
--incDmac=INCDMAC increment dest mac repeating after N iterations (max
65535)
-e ETHERTYPE, --ethertype=ETHERTYPE
ethertype (default: 0x1234)
-V IP_VERSION, --ip-version=IP_VERSION
IP version either 4 or 6 (default: 4)
-p, --progress display progress indication to stdout
--vlan=VLAN vlan id (default: no tag, or 0 if --vpri is set)
--vpri=VPRI vlan priority (default: no tag, or 0 if --vlan is set)
--dei dei (default: no tag, or 0 if --vpri is set)
--vlan-tpid=VLAN_TPID
vlan TPID (default: 0x8100)
--inner-vlan=INNER_VLAN
inner vlan id (default: no tag, or 0 if --inner-vpri
is set)
--inner-vpri=INNER_VPRI
inner vlan priority (default: no tag, or 0 if --inner-
vlan is set)
--inner-dei inner vlan dei ( default: no tag, or 0 if --inner-vpri
or --inner-vlan is set)
--inner-vlan-tpid=INNER_VLAN_TPID
inner vlan TPID (default: 0x8100)
--ip-src=ADDR source IP address
--ip-dst=ADDR destination IP address
--ip-protocol=PROTO IP protocol number or name (default: 63)
--ip-src-inc=IP_SRC_INC
increment source IP address, repeating after N
iterations
--ip-dst-inc=IP_DST_INC
increment destination IP address, repeating after N
iterations
--ttl=TTL IP TTL (Time To Live) value (default: 64)
--tos=TOS IP TOS (Type Of Service) value (default: 0)
--flow-label=FLOW_LABEL
IPv6 Flow Label value (default: 0)
--dont-fragment Set IP Don't Fragment flag as 1
--more-fragments Set IP More Fragments flag as 1
--frag-offset=FRAG_OFFSET
Fragment offset in units of 64-bits (e.g. 1 = 64 bits)
--ip-id=IP_ID IP header id
--router-alert add a Router Alert IP option
--cksum=CKSUM IP Checksum
--ipver=IPVER IPv4 version to generate a version error
--iphlen=IPHLEN IPv4 Header Length
--udp-sport=PORT UDP source port number
--udp-dport=PORT UDP destination port number
--icmp-type=ICMP_TYPE
ICMP type
--icmp-code=ICMP_CODE
ICMP code
--inner-udp-sport=PORT
inner source UDP port for a tunneled IP/UDP packet
--inner-udp-dport=PORT
inner dest UDP port for a tunneled IP/UDP packet
--inner-tcp-sport=PORT
inner source TCP port for a tunneled IP/TCP packet
--inner-tcp-dport=PORT
inner dest TCP port for a tunneled IP/TCP packet
--inner-tcp-flags=INNER_TCP_FLAGS
Set TCP control flags: U,A,P,R,S,F
--inner-ip-protocol=PROTO
IP protocol number or name (default: 63) for a
tunneled IP packet
--inner-ttl=INNER_TTL
IP TTL (Time To Live) value (default: 64) for a
tunneled IP packet
--inner-tos=INNER_TOS
IP TOS (Type Of Service) value (default: 0) for a
tunneled IP packet
--inner-flow-label=INNER_FLOW_LABEL
IPv6 Flow Label value (default: 0) for a tunneled IP
packet
--inner-ip-src=ADDR inner source IP address for a tunneled IP packet
--inner-ip-dst=ADDR inner destination IP address for a tunneled IP packet
--inner-smac=INNER_SMAC
source MAC address for inner header of a tunneled
packet (default: 00:00:aa:aa:aa:aa)
--inner-dmac=INNER_DMAC
destination MAC address for inner header of a tunneled
packet (default ff:ff:ff:ff:ff:ff)
--inner-ethertype=INNER_ETHERTYPE
ethertype for inner header of a tunneled packet
(default: 0x0800 for IP)
--inner-ip-version=INNER_IP_VERSION
IP version either 4 or 6 (default: 4) of a tunneled IP
packet
--inner-dont-fragment
Set IP Don't Fragment flag as 1 for a tunneled IP
packet
--inner-more-fragments
Set IP More Fragments flag as 1 for a tunneled IP
packet
--inner-frag-offset=INNER_FRAG_OFFSET
Fragment offset in units of 64-bits (e.g. 1 = 64 bits)
for a tunneled IP packet
--inner-ip-id=INNER_IP_ID
IP header id for a tunneled IP packet
--inner-arp=INNER_ARP
ARP: "request", "reply"
--inner-ndp=INNER_NDP
--inner-ndp <"nbr-solicit", "nbr-advt", "rtr-solicit">
--vxlan-vni=VXLAN_VNI
vni for Vxlan packet (adds vxlan header). Also: Sets
IP_PROTO to udp and dest port to vxlan port, unless
overridden
--vxlan-flags=VXLAN_FLAGS
Sets VXLAN flags (first 8 bits of VXLAN header)
--payload-vlan=PAYLOAD_VLAN
Payload vlan id (default: no tag, or 0 if --payload-
vpri is set)
--payload-vpri=PAYLOAD_VPRI
Payload vlan priority (default: no tag, or 0 if
--payload-vlan is set)
--payload-dei payload vlan dei ( default: no tag, or 0 if --payload-
vlan or --payload-vpri is set)
--payload-vlan-tpid=PAYLOAD_VLAN_TPID
Payload vlan TPID (default: 0x8100)
--payload-inner-vlan=PAYLOAD_INNER_VLAN
Payload inner vlan id (default: no tag, or 0 if
--payload-inner-vpri is set)
--payload-inner-dei payload inner vlan dei ( default: no tag, or 0 if
--payload-inner-vpri or --payload-inner-vlan is set)
--payload-inner-vpri=PAYLOAD_INNER_VPRI
Payload inner vlan priority (default: no tag, or 0 if
--payload-inner-vlan is set)
--payload-inner-vlan-tpid=PAYLOAD_INNER_VLAN_TPID
Payload inner vlan TPID (default: 0x8100)
--mpls-label=LABEL A comma separated list of MPLS (Multiprotocol Label
Switching) labels to be added to the packet. Specified
from top to bottem
--mpls-ttl=MPLS_TTL comma separated MPLS TTL (Time To Live) value
(default: 64)
--mpls-exp=MPLS_EXP comma separted MPLS EXP (Experimental ) value
(default: 0)
--gre enable Generic Routing Encapsulation (GRE)
--gre-over-mpls enable Generic Routing Encapsulation (GRE) over MPLS
--gtpv1 enable GTPv1 encapsulation
--gtpv1-msg-type=GTPV1_MSG_TYPE
GTPv1 message type
--gtpv1-teid=GTPV1_TEID
GTPv1 tunnel endpoint identifier
--eth-over-gre enable Ethernet over Generic Routing Encapsulation
(GRE)
--udp-over-mpls enable UDP over MPLS
--eth-over-mpls enable Ethernet over MPLS
--mpls-pw-cw-type=MPLS_PW_CW_TYPE
set the MPLS Pseudowire Control Word Type (default 0)
--mpls-pw-cw-flags=MPLS_PW_CW_FLAGS
set the MPLS Pseudowire Control Word Flags (default 0)
--mpls-pw-cw-frg=MPLS_PW_CW_FRG
set the MPLS Pseudowire Control Word Fragment (default
0)
--mpls-pw-cw-seqno=MPLS_PW_CW_SEQNO
set the MPLS Pseudowire Control Word Sequence Number
(default 0)
--mpls-pw-cw-raw=MPLS_PW_CW_RAW
set the raw MPLS Pseudowire Control Word (4-byte hex
string)
--gre-protocol=PROTO set the protocol type of the GRE payload (default:
0x0800 (IP))
--gre-version=VER set the GRE version number (default 0)
--gre-checksum=VALUE enable Checksum Present bit in GRE header and insert
checksum with VALUE, not enabled by default
--gre-key=VALUE enable Key Present bit in GRE header and insert key
with VALUE, not enabled by default
--gre-sequence=VALUE enable Sequence Number Present bit in GRE header and
insert sequence number with VALUE, not enabled by
default
--data-type=TYPE one of: constant, incrementing, random, raw (default:
incrementing)
--data-value=VALUE payload value if data-type is 'constant' or 'raw'
constant: single byte repeated to fill payload SIZE
raw: hex string for payload, zero padded if short
(default: 0)
--random-seed=SEED seed for random number generator
--vnTagSVif=VNTAGSVIF
source Vif, the vif_id of the port that add the vntag
--vnTagDVif=VNTAGDVIF
destination Vif, identifies the destination port
--br=BR IEEE 802.1BR E-tag
--l2-ts-ver=L2_TS_VER
Arista L2 timestamp tag version
--l2-ts-sec=L2_TS_SEC
Arista L2 timestamp tag seconds
--l2-ts-nsec=L2_TS_NSEC
Arista L2 timestamp tag nanoseconds
--dzgre enable DzGRE header
--dzgre-version=VER set the DzGRE version number (default 0)
--dzgre-entropy=VALUE
Arista DzGRE entropy
--dzgre-switch-id=DZGRE_SWITCH_ID
Arista DzGRE switch Id
--dzgre-port-id=DZGRE_PORT_ID
Arista DzGRE port Id
--dzgre-policy-id=DZGRE_POLICY_ID
Arista DzGRE policy Id
-n NUM, --num=NUM total number of packets to send (default: 1)
--seq replace last four bytes of user payload with
incrementing sequence value
-b BURST, --burst=BURST
number of packets in each burst (default: 1)
--sleep=SLEEP how long to sleep (in seconds) after each burst
(default: 0.0)
-c, --continuous run continuously
-B SNDBUF, --sndbuf=SNDBUF
socket send-buffer size to use
--arp=ARP ARP: "request", "reply"
--rarp=RARP RARP: "request", "reply"
--arp-sha=ARPSHA Sender Hardware Address in ARP/RARP message (default:
smac)
--ndp=NDP --ndp <"nbr-solicit", "nbr-advt", "rtr-solicit">
--isl-f1=F1 f1 field in ISL header
--isl-f2=F2 f2 field in ISL header
--isl-sglort=SGLORT sglort field in ISL header
--isl-dglort=DGLORT dglort field in ISL header
--txraw-fap=TXRAWFAP src FAP in txraw header
--svtag=SVTAG 4 byte svtag
--ptch-sysSrcPort=SYSSRCPORT
src Port to inject packet from
--itmh-sysDestPort=SYSDESTPORT
sysDestPort in ITMH header
--raw=RAW Hexidecimal byte stream (e.g. 0xaaaa010234....) of a
pre-formed packet to use. All other packet building
options are ignored.
--stdout write packet to stdout
--hexDump print the hex value of the packet
--tcp-flags=TCP_FLAGS
Set TCP control flags: U,A,P,R,S,F
--tcp-sport=TCP_SPORT
TCP source port number
--tcp-dport=TCP_DPORT
TCP destination port number
--tcp-mss=TCP_MSS TCP maximum segment size
--esmc-ssm=ESMC_SSM ESMC SSM value (0-15)
--esmc-type=ESMC_TYPE
ESMC type: informational (I) or event (E) (default: I)
--src-port-inc=SRC_PORT_INC
increment source port, repeating after N iterations
(max 65535)
--dst-port-inc=DST_PORT_INC
increment destination port, repeating after N
iterations (max 65535)
Previous page: Control Plane MTU
Next page: iperf