mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
Move NAT gateway firewall rules to recovered|updatenatgw events.
The existing code wasn't working as designed in the start event. It should work here. BZ: 62613 Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit aeb70c7e7822854eb87873a5c7783e27e6e72318)
This commit is contained in:
parent
8b0bbf960b
commit
6ce1501aa1
6
ctdb/config/events.d/11.natgw
Normal file → Executable file
6
ctdb/config/events.d/11.natgw
Normal file → Executable file
@ -69,6 +69,12 @@ case "$1" in
|
||||
# This is the first node, set it up as the NAT GW
|
||||
echo 1 >/proc/sys/net/ipv4/ip_forward
|
||||
iptables -A POSTROUTING -t nat -s $CTDB_NATGW_PRIVATE_NETWORK -d ! $CTDB_NATGW_PRIVATE_NETWORK -j MASQUERADE
|
||||
|
||||
# block all incoming connections to the natgw address
|
||||
CTDB_NATGW_PUBLIC_IP_HOST=`echo $CTDB_NATGW_PUBLIC_IP | sed -e "s/\/.*/\/32/"`
|
||||
iptables -D INPUT -p tcp --syn -d $CTDB_NATGW_PUBLIC_IP_HOST -j REJECT 2>/dev/null
|
||||
iptables -I INPUT -p tcp --syn -d $CTDB_NATGW_PUBLIC_IP_HOST -j REJECT 2>/dev/null
|
||||
|
||||
ip addr add $CTDB_NATGW_PUBLIC_IP dev $CTDB_NATGW_PUBLIC_IFACE
|
||||
ip route add 0.0.0.0/0 via $CTDB_NATGW_DEFAULT_GATEWAY >/dev/null 2>/dev/null
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user