Created
January 6, 2016 19:01
-
-
Save azrdev/e7a8a75b25fb7f96ae4c to your computer and use it in GitHub Desktop.
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
# /etc/dnsmasq.d/gateway | |
address=/larsa/10.0.0.1 | |
dhcp-range=eth0,10.0.0.100,10.0.0.200,1h | |
dhcp-boot=pxelinux.0 | |
enable-tftp | |
tftp-root=/srv/tftp |
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 | |
test "$2" == "" && exit 1 | |
if_inet=$1 | |
if_local=$2 | |
systemctl stop dhcpcd@$if_local | |
ip -stats addr flush dev $if_local | |
ip -stats addr add 10.0.0.1/24 dev $if_local | |
sysctl net.ipv4.ip_forward=1 | |
iptables -t nat -A POSTROUTING -o $if_inet -j MASQUERADE | |
dnsmasq -C /etc/dnsmasq.d/gateway -i $if_local -d | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment