diff --git a/hack/e2e.sh b/hack/e2e.sh index 90c8314d9..db86d04fd 100755 --- a/hack/e2e.sh +++ b/hack/e2e.sh @@ -8,6 +8,15 @@ if [ "$COZYSTACK_INSTALLER_YAML" = "" ]; then exit 1 fi +if [ "$(cat /proc/sys/net/ipv4/ip_forward)" != 1 ]; then + echo "IPv4 forwarding is not enabled!" >&2 + echo 'please enable forwarding with the following command:' >&2 + echo >&2 + echo 'echo 1 > /proc/sys/net/ipv4/ip_forward' >&2 + echo >&2 + exit 1 +fi + set -x set -e @@ -18,6 +27,10 @@ ip link add cozy-br0 type bridge ip link set cozy-br0 up ip addr add 192.168.123.1/24 dev cozy-br0 +# Enable masquerading +iptables -t nat -D POSTROUTING -s 192.168.123.0/24 ! -d 192.168.123.0/24 -j MASQUERADE || true +iptables -t nat -A POSTROUTING -s 192.168.123.0/24 ! -d 192.168.123.0/24 -j MASQUERADE + rm -rf srv1 srv2 srv3 mkdir -p srv1 srv2 srv3