Created
September 6, 2019 14:47
-
-
Save jivoi/51d3b57ac719cd14e8ac7401fc39c7be 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
#!/bin/bash | |
IF_IN="eth0" | |
IF_OUT="wlan0" | |
SUB="192.168.100" | |
echo "[+] Bringing interface ${IF_IN} down" | |
ip addr del ${SUB}.1/24 dev ${IF_IN} | |
ip link set dev ${IF_IN} down | |
echo "[+] Removing iptable rules" | |
iptables -t nat -D POSTROUTING -s ${SUB}.0/24 -j MASQUERADE | |
iptables -D FORWARD -o ${IF_IN} -i ${IF_OUT} -s ${SUB}.0/24 -m conntrack --ctstate NEW -j ACCEPT | |
iptables -D FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
echo "[+] Stopping DHCP server" | |
killall dhcpd | |
echo "[+] Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment