21 lines
516 B
Bash
Executable File
21 lines
516 B
Bash
Executable File
#!/bin/bash -x
|
|
|
|
if [ "$EUID" != 0 ]; then
|
|
echo "this script must be run as root" >&2
|
|
exit
|
|
fi
|
|
|
|
BRIDGE="${1-virbr0}"
|
|
|
|
sysctl net.ipv4.conf.all.forwarding=0
|
|
|
|
ip link del dev "$BRIDGE"
|
|
|
|
iptables -S | sed -n '/QEMU/s/-A/iptables -D/p' | bash
|
|
iptables -S -tnat | sed -n '/QEMU/s/-A/iptables -tnat -D/p' | bash
|
|
|
|
iptables -S | sed -n '/QEMU/s/-N/iptables -X/p' | bash
|
|
iptables -S -tnat | sed -n '/QEMU/s/-N/iptables -tnat -X/p' | bash
|
|
|
|
kill -TERM "$(cat /var/run/dnsmasq-virbr0.pid)"
|