Created
September 5, 2022 11:30
-
-
Save danyanya/7a4ecaff4ac4d70a99b7a77ff990da88 to your computer and use it in GitHub Desktop.
MIkrotik TFTP script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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