Redirect iptables output to /dev/null on cleanup
This commit is contained in:
parent
503e715d4e
commit
c04f7f0bd8
12
create_ap
12
create_ap
@ -259,9 +259,9 @@ cleanup() {
|
||||
|
||||
if [[ "$SHARE_METHOD" != "none" ]]; then
|
||||
if [[ "$SHARE_METHOD" == "nat" ]]; then
|
||||
iptables -t nat -D POSTROUTING -o ${INTERNET_IFACE} -j MASQUERADE
|
||||
iptables -D FORWARD -i ${WIFI_IFACE} -s ${GATEWAY%.*}.0/24 -j ACCEPT
|
||||
iptables -D FORWARD -i ${INTERNET_IFACE} -d ${GATEWAY%.*}.0/24 -j ACCEPT
|
||||
iptables -t nat -D POSTROUTING -o ${INTERNET_IFACE} -j MASQUERADE > /dev/null 2>&1
|
||||
iptables -D FORWARD -i ${WIFI_IFACE} -s ${GATEWAY%.*}.0/24 -j ACCEPT > /dev/null 2>&1
|
||||
iptables -D FORWARD -i ${INTERNET_IFACE} -d ${GATEWAY%.*}.0/24 -j ACCEPT > /dev/null 2>&1
|
||||
[[ -n $OLD_IP_FORWARD ]] && echo $OLD_IP_FORWARD > /proc/sys/net/ipv4/ip_forward
|
||||
elif [[ "$SHARE_METHOD" == "bridge" ]]; then
|
||||
ip link set down $BRIDGE_IFACE
|
||||
@ -271,9 +271,9 @@ cleanup() {
|
||||
fi
|
||||
|
||||
if [[ "$SHARE_METHOD" != "bridge" ]]; then
|
||||
iptables -D INPUT -p tcp -m tcp --dport 53 -j ACCEPT
|
||||
iptables -D INPUT -p udp -m udp --dport 53 -j ACCEPT
|
||||
iptables -D INPUT -p udp -m udp --dport 67 -j ACCEPT
|
||||
iptables -D INPUT -p tcp -m tcp --dport 53 -j ACCEPT > /dev/null 2>&1
|
||||
iptables -D INPUT -p udp -m udp --dport 53 -j ACCEPT > /dev/null 2>&1
|
||||
iptables -D INPUT -p udp -m udp --dport 67 -j ACCEPT > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ $NO_VIRT -eq 0 ]]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user