14 |
return 1 |
return 1 |
15 |
fi |
fi |
16 |
|
|
17 |
if [ ! -x $(which iptables 2>/dev/null) ] |
if [ ! -x $(type -P iptables) ] |
18 |
then |
then |
19 |
logger -s -p daemon.err -t qemu-networking.service \ |
logger -s -p daemon.err -t qemu-networking.service \ |
20 |
"No 'iptables' executable found, please install 'net-misc/iptables'" |
"No 'iptables' executable found, please install 'net-misc/iptables'" |
21 |
return 1 |
return 1 |
22 |
fi |
fi |
23 |
|
|
24 |
if [ ! -x $(which vde_switch 2>/dev/null) ] |
if [ ! -x $(type -P vde_switch) ] |
25 |
then |
then |
26 |
logger -s -p daemon.err -t qemu-networking.service \ |
logger -s -p daemon.err -t qemu-networking.service \ |
27 |
"No 'vde_switch' executable found, please install 'net-misc/vde2'" |
"No 'vde_switch' executable found, please install 'net-misc/vde2'" |
28 |
return 1 |
return 1 |
29 |
fi |
fi |
30 |
|
|
31 |
if [ ! -x $(which sysctl 2>/dev/null) ] |
if [ ! -x $(type -P sysctl) ] |
32 |
then |
then |
33 |
logger -s -p daemon.err -t qemu-networking.service \ |
logger -s -p daemon.err -t qemu-networking.service \ |
34 |
"No 'sysctl' executable found, please install 'sys-apps/procps'" |
"No 'sysctl' executable found, please install 'sys-apps/procps'" |
54 |
stop) |
stop) |
55 |
checkconfig || exit 6 |
checkconfig || exit 6 |
56 |
|
|
57 |
# maquerade and forward |
# masquerade and forward |
58 |
iptables -t nat -D POSTROUTING -s ${VMNETWORK} -o ${BRIDGEDEV} -j MASQUERADE |
iptables -t nat -D POSTROUTING -s ${VMNETWORK} -o ${BRIDGEDEV} -j MASQUERADE |
59 |
|
|
60 |
# destroy interface |
# destroy interface |