From 7acaae68b4ca4fc9740d6740f4107555026d7ab5 Mon Sep 17 00:00:00 2001 From: cbkhare Date: Thu, 7 Jan 2021 14:43:50 +0530 Subject: [PATCH] provisioner setup changes to enable NAT for workers provisioner setup changes to enable NAT for workers Signed-off-by: cbkhare --- setup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index db12b97..0b637f3 100755 --- a/setup.sh +++ b/setup.sh @@ -487,6 +487,12 @@ whats_next() ( echo "$BLANK Follow the steps described in https://tinkerbell.org/examples/hello-world/ to say 'Hello World!' with a workflow." ) +setup_nat() ( + iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT + iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT + iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +) + do_setup() ( # perform some very rudimentary platform detection lsb_dist=$(get_distribution) @@ -504,7 +510,7 @@ do_setup() ( source "$ENV_FILE" setup_networking "$lsb_dist" "$lsb_version" - + setup_nat setup_osie generate_certificates setup_docker_registry