Send raw Ethernet frame with custom data after EtherType using nping

2k Views Asked by At

I am using nping to send raw a Ethernet frame. I want to send a frame with custom data starting after the EtherType. However, nping puts the custom data in the middle of the packet. For example, here's my command:

nping --dest-mac <my mac> --ether-type 0xd2d2  -e eth0 --send-eth --data 00010028 192.168.2.10

and here's what I see on the receiver:

    0x0000:  8cfd f000 cb16 9410 3eb8 483d d2d2 4500
    0x0010:  0020 f412 0000 4001 0169 c0a8 0207 c0a8
    0x0020:  020a 0800 9a72 5d61 0003 0001 0028 0000
    0x0030:  0000 0000 0000 0000 0000 0000

In the third line I want the 6th and 7th half words, 0001 0028 to come after 0xd2d2

1

There are 1 best solutions below

4
kaitoy On

The custom data nping put is an IP header.

I'm not familiar with nping, but I guess the 192.168.2.10 you put at the end of your command is doing wrong. It's encoded at 16th and 17th half words (destination IP address) as c0a8 020a. Probably nping added the IP header because you specified 192.168.2.10.

Try the command without 192.168.2.10, or <my mac> instead of 192.168.2.10.