Scapy in Trex

270 views
Skip to first unread message

Nagraj K

unread,
Feb 15, 2021, 2:49:22 AM2/15/21
to TRex Traffic Generator
Hello,

Trying to use scapy notation with trex i.e with "pkt" cli. I can generate a ping command to an ip address but not using a fqdn name. Is there some other way of using fqdn instead of ip with trex ?  tried with "debug" also, getting into same issue..

With IP, it works 
==================================
trex>pkt -p 0 -s Ether()/IP(dst="1.2.3.4")

Pushing 1 packets on port(s) [0]:                            [SUCCESS]

6.23 [ms]

trex>pkt -p 0 -s Ether()/IP(dst="www.google.com")
usage: pkt [-h] [-p PORTS [PORTS ...] | -a] [-n] (-s PACKET | --layers)
           [--force]

pkt: error: argument -s: invalid scapy expression: 'Ether()/IP(dst="www.google.com")' - invalid literal for int() with base 10: 'www'

trex>
trex>
trex>
trex>
trex>pkt -p 0 -s Ether()/IP(dst="1.2.3.4")/ICMP()

Pushing 1 packets on port(s) [0]:                            [SUCCESS]

6.95 [ms]


trex>
But not with fqdn
======================

  trex>pkt -p 0 -s Ether()/IP(dst="google.com")/ICMP()
usage: pkt [-h] [-p PORTS [PORTS ...] | -a] [-n] (-s PACKET | --layers)
           [--force]

pkt: error: argument -s: invalid scapy expression: 'Ether()/IP(dst="google.com")/ICMP()' - invalid literal for int() with base 10: 'google'

trex>pkt -p 0 -s Ether()/IP(dst="www.google.com")/ICMP()
usage: pkt [-h] [-p PORTS [PORTS ...] | -a] [-n] (-s PACKET | --layers)
           [--force]

pkt: error: argument -s: invalid scapy expression: 'Ether()/IP(dst="www.google.com")/ICMP()' - invalid literal for int() with base 10: 'www'

trex>

Thanks,
Nagraj

Besart Dollma

unread,
Feb 15, 2021, 8:35:11 AM2/15/21
to TRex Traffic Generator
Hi,
No, there is no such way.
TRex doesn't provide DNS services. It is a traffic generator.
If you really want to do it, you can hook Scapy's constructor to provide a DNS query.
Thanks,
Bes

Reply all
Reply to author
Forward
0 new messages