'service import' feature
This commit is contained in:
1 parent
7cc2581a94
commit
d0dc7b7556
2 files changed
+49
-9
No files matched your search
+8
-4
@@ -40,14 +40,18 @@ create_bridge() {
|
||||
ip link set dev $BRIDGE up
|
||||
}
|
||||
|
||||
setup_masquerading() {
|
||||
IPTABLES_ARGS="POSTROUTING -d $IPADDR ! -s $IPADDR -j MASQUERADE"
|
||||
if ! iptables -w -t nat -C $IPTABLES_ARGS >/dev/null 2>&1
|
||||
add_nat_rule() {
|
||||
if ! iptables -w -t nat -C $1 >/dev/null 2>&1
|
||||
then
|
||||
iptables -w -t nat -A $IPTABLES_ARGS >/dev/null
|
||||
iptables -w -t nat -A $1 >/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
setup_masquerading() {
|
||||
add_nat_rule "POSTROUTING -d $IPADDR ! -s $IPADDR -j MASQUERADE"
|
||||
add_nat_rule "POSTROUTING -s $IPADDR ! -d $IPADDR -j MASQUERADE"
|
||||
}
|
||||
|
||||
case "$COMMAND" in
|
||||
launch)
|
||||
[ $# -gt 0 ] || usage
|
||||
|
||||
Reference in new issue
Block a user