Skip to content

Instantly share code, notes, and snippets.

@danyanya
Created September 5, 2022 11:30
Show Gist options
  • Save danyanya/7a4ecaff4ac4d70a99b7a77ff990da88 to your computer and use it in GitHub Desktop.
Save danyanya/7a4ecaff4ac4d70a99b7a77ff990da88 to your computer and use it in GitHub Desktop.
MIkrotik TFTP script
#!/bin/bash
# Usage: bash loader.sh file.bin enp5s0
USER=${USER}
IFNAME=$2
/sbin/ip addr replace 192.168.99.10/24 dev $IFNAME
/sbin/ip link set dev $IFNAME up
/usr/sbin/dnsmasq --user=$USER \
--no-daemon \
--listen-address 192.168.99.10 \
--bind-interfaces \
-p0 \
--dhcp-authoritative \
--dhcp-range=192.168.99.100,192.168.99.200 \
--bootp-dynamic \
--dhcp-boot=$(basename $1) \
--log-dhcp \
--enable-tftp \
--tftp-root=$(pwd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment