Skip to content

Instantly share code, notes, and snippets.

View sassyn's full-sized avatar

Sassy Natan sassyn

  • Israel
View GitHub Profile
@sassyn
sassyn / ec2_multicast.sh
Created June 8, 2021 14:18 — forked from kntyskw/ec2_multicast.sh
Script to enable IP multicast without using Ethernet broadcast. It uses tc mirred and pedit actions to copy and edit an IP multicast packet to send over multiple Ethernet unicast frames. It requires two network interfaces to work. One is the interface to grab original multicast packets from and the other is to send out modified packets. This is …
#!/bin/sh
[[ -n "$1" && -n "$2" ]] || { echo "Usage: $0 <interface to grab multicast packets from> <interface to send modified packets to> [target MAC address 1] [target MAC address 2] ..."; exit 0 ; }
IIF=$1
OIF=$2
shift
shift
SRC_MACADDR=`ip link show $OIF | awk '/ether/ {print $2}' | tr -d :`