This utility will relay limited broadcasts (255.255.255.255) from an interface to another interface (or on the same interface). You can use this utility for VPN servers to forward limited broadcast.
Install dependencies
apt install libnl-3-200 libnl-genl-3-200 dbus
Download the utility and install the systemd service.
URI=$(curl -s https://api.github.com/repos/Golit/broadcast-relay/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4)
curl -L -o /usr/local/bin/broadcast-relay $URI
chmod +x /usr/local/bin/broadcast-relay
cat > /etc/systemd/system/[email protected] <<EOF
[Unit]
Description=Relay For Limited Broadcasts On Interface %I
[email protected]
[Service]
Type=simple
ExecStart=/usr/local/bin/broadcast-relay --interface-in %i --interface-out %i
[Install]
WantedBy=multi-user.target
EOF
systemctl enable broadcast-relay@tap0
systemctl start broadcast-relay@tap0
broadcast-relay [-i <interface with broadcasts>] [-o <interface where to relay broadcasts>] [-h] [-l <loglevel>]
broadcast-relay --interface-in tap0 --interface-out tap0
apk add gcc git make libpcap-dev libc-dev libnl3-dev dbus-dev linux-headers
make
cp broadcast-relay /usr/local/bin/
Contributions are welcome.
http://www.tcpdump.org/pcap.html
http://eecs.wsu.edu/~sshaikot/docs/lbpcap/libpcap-tutorial.pdf
https://linux.die.net/man/3/getopt_long
http://opensourceforu.com/2015/03/a-guide-to-using-raw-sockets/