0

I am currently testing a scenario using Python and scapy.

When I send a packet which has a src mac of 80:CA:0E:BD:60:3B and destination mac of 82:DA:0E:BD:60:3A, the packet is sent out the specified interface.

If I then swap the src and destination macs, the packet is no longer sent.

If I then revert the macs, the original packet is also no longer sent.

Interestingly, if I wait a few minutes, the swapped mac packet is allowed through.

My python code is as follows:

from scapy.all import *

# this packet is sent
sendp(Ether(src="80:CA:0E:BD:60:3B", dst="82:DA:0E:BD:60:3A")/IP(dst="192.168.0.71",src="192.168.0.75")/UDP(sport=2152,dport=2152), iface="enp0s9")

# this packet does not get sent, until after a few mins
sendp(Ether(dst="80:CA:0E:BD:60:3B", src="82:DA:0E:BD:60:3A")/IP(dst="192.168.0.71",src="192.168.0.75")/UDP(sport=2152,dport=2152), iface="enp0s9")

Does Linux keep track of the source and destination mac addresses to decide whether to actually send the packet?

What appears to be happening is Linux is not sending the swapped packet because it sees that it is destined for itself based on the previous sent packet.

  • 2
    the switch is probably refusing the packet – jsotola May 17 at 1:40
  • @jsotola We did try repowering the switch (non-managed switch), but the packet was still not being seen at the target. – wei May 19 at 22:38
  • 1
    if you really want to investigate this, then use a hub between the computer and the switch .... connect another computer to the hub and monitor the network traffic using a sniffer program such as wireshark – jsotola May 20 at 0:20
  • @jsotola is hub is still a thing ? – Kiwy May 20 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.