Skip to content

Commit 8c62365

Browse files
VPC VR: fix empty iptables if there is no vpc tier (apache#8787)
1 parent 720407b commit 8c62365

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

systemvm/debian/opt/cloud/bin/setup/postinit.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@ log_it() {
2626
# Restart journald for setting changes to apply
2727
systemctl restart systemd-journald
2828

29+
# Restore the persistent iptables nat, rules and filters for IPv4 and IPv6 if they exist
30+
ipv4="/etc/iptables/rules.v4"
31+
if [ -e $ipv4 ]
32+
then
33+
iptables-restore < $ipv4
34+
fi
35+
36+
ipv6="/etc/iptables/rules.v6"
37+
if [ -e $ipv6 ]
38+
then
39+
ip6tables-restore < $ipv6
40+
fi
41+
2942
CMDLINE=/var/cache/cloud/cmdline
3043
TYPE=$(grep -Po 'type=\K[a-zA-Z]*' $CMDLINE)
3144
if [ "$TYPE" == "router" ] || [ "$TYPE" == "vpcrouter" ] || [ "$TYPE" == "dhcpsrvr" ]
@@ -52,17 +65,4 @@ do
5265
systemctl disable --now --no-block $svc
5366
done
5467

55-
# Restore the persistent iptables nat, rules and filters for IPv4 and IPv6 if they exist
56-
ipv4="/etc/iptables/rules.v4"
57-
if [ -e $ipv4 ]
58-
then
59-
iptables-restore < $ipv4
60-
fi
61-
62-
ipv6="/etc/iptables/rules.v6"
63-
if [ -e $ipv6 ]
64-
then
65-
ip6tables-restore < $ipv6
66-
fi
67-
6868
date > /var/cache/cloud/boot_up_done

0 commit comments

Comments
 (0)