Skip to content
This repository has been archived by the owner on Apr 25, 2019. It is now read-only.

Commit

Permalink
Merge pull request #20 from x42en/master
Browse files Browse the repository at this point in the history
Kill dnsmasq instead of dhcp and restore previous iptables rules
  • Loading branch information
binkybear committed Dec 28, 2016
2 parents 924456a + 8a64208 commit d12f819
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
10 changes: 8 additions & 2 deletions usr/share/mana-toolkit/run-mana/start-nat-full-lollipop.sh
Expand Up @@ -37,8 +37,13 @@ ip route add 10.0.0.0/24 dev $phy scope link table $table
# http://lists.netfilter.org/pipermail/netfilter-buglog/2013-October/002995.html
iptables -F bw_INPUT
iptables -F bw_OUTPUT

# Save
# iptables-save > /tmp/rules.txt
iptables-save > /tmp/rules.txt
# Remove non-working export lines
sed --in-place '/rmnet0/d' /tmp/rules.txt
sed --in-place '/TCPMSS/d' /tmp/rules.txt

# Flush
iptables --policy INPUT ACCEPT
iptables --policy FORWARD ACCEPT
Expand Down Expand Up @@ -86,7 +91,8 @@ sleep 5

echo "Hit enter to kill me"
read
pkill dhcpd
#pkill dhcpd
pkill dnsmasq
pkill sslstrip
pkill sslsplit
pkill hostapd
Expand Down
17 changes: 13 additions & 4 deletions usr/share/mana-toolkit/run-mana/start-nat-simple-bdf-lollipop.sh
Expand Up @@ -37,8 +37,14 @@ ip route add 10.0.0.0/24 dev $phy scope link table $table
# http://lists.netfilter.org/pipermail/netfilter-buglog/2013-October/002995.html
iptables -F bw_INPUT
iptables -F bw_OUTPUT

# Save
# iptables-save > /tmp/rules.txt
iptables-save > /tmp/rules.txt
# Remove non-working export lines
sed --in-place '/rmnet0/d' /tmp/rules.txt
sed --in-place '/TCPMSS/d' /tmp/rules.txt


# Flush
iptables --policy INPUT ACCEPT
iptables --policy FORWARD ACCEPT
Expand All @@ -63,14 +69,17 @@ echo $! > /tmp/bdfproxy.pid

echo "Hit enter to kill me"
read
pkill dhcpd
#pkill dhcpd
pkill dnsmasq
pkill sslstrip
pkill sslsplit
pkill hostapd
pkill python

# Restore
# iptables-restore < /tmp/rules.txt
# rm /tmp/rules.txt
iptables-restore < /tmp/rules.txt
rm /tmp/rules.txt

# Remove iface and routes
ip addr flush dev $phy
ip link set $phy down
20 changes: 14 additions & 6 deletions usr/share/mana-toolkit/run-mana/start-nat-simple-lollipop.sh
Expand Up @@ -37,8 +37,13 @@ ip route add 10.0.0.0/24 dev $phy scope link table $table
# http://lists.netfilter.org/pipermail/netfilter-buglog/2013-October/002995.html
iptables -F bw_INPUT
iptables -F bw_OUTPUT

# Save
# iptables-save > /tmp/rules.txt
iptables-save > /tmp/rules.txt
# Remove non-working export lines
sed --in-place '/rmnet0/d' /tmp/rules.txt
sed --in-place '/TCPMSS/d' /tmp/rules.txt

# Flush
iptables -F
iptables -F -t nat
Expand All @@ -48,14 +53,17 @@ iptables -A FORWARD -i $phy -o $upstream -j ACCEPT

echo "Hit enter to kill me"
read
pkill dhcpd
#pkill dhcpd
pkill dnsmasq
pkill sslstrip
pkill sslsplit
pkill hostapd
pkill python
## Restore
#iptables-restore < /tmp/rules.txt
#rm /tmp/rules.txt
## Remove iface and routes

# Restore
iptables-restore < /tmp/rules.txt
rm /tmp/rules.txt

# Remove iface and routes
ip addr flush dev $phy
ip link set $phy down

0 comments on commit d12f819

Please sign in to comment.