mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-24 14:54:24 +00:00
15 lines
494 B
Bash
Executable file
15 lines
494 B
Bash
Executable file
#!/bin/sh
|
|
|
|
zt0="$(ifconfig | grep 'zt' | awk '{print $1}')"
|
|
[ -z "${zt0}" ] && zt0="$(cat "/tmp/zt.nif")"
|
|
|
|
for i in ${zt0}
|
|
do
|
|
ip_segment=""
|
|
iptables -D FORWARD -i "$i" -j ACCEPT 2>/dev/null
|
|
iptables -D FORWARD -o "$i" -j ACCEPT 2>/dev/null
|
|
iptables -t nat -D POSTROUTING -o "$i" -j MASQUERADE 2>/dev/null
|
|
ip_segment="$(ip route | grep "dev $i proto" | awk '{print $1}')"
|
|
iptables -t nat -D POSTROUTING -s "${ip_segment}" -j MASQUERADE 2>/dev/null
|
|
echo "zt interface $i is stopped!"
|
|
done
|