provisioner setup changes to enable NAT for workers (#33)

## Description

Provisioner NAT setup for workers 

## Why is this needed

internet access on workers 
https://github.com/tinkerbell/sandbox/issues/31 


Fixes: #

## How Has This Been Tested?

- workflow executed successfully.
- ping from workers works correctly.

PR in reference with https://github.com/tinkerbell/tink/pull/410
This commit is contained in:
mergify[bot] 2021-01-07 13:43:24 +00:00 committed by GitHub
commit b504810679
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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." 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() ( do_setup() (
# perform some very rudimentary platform detection # perform some very rudimentary platform detection
lsb_dist=$(get_distribution) lsb_dist=$(get_distribution)
@ -504,7 +510,7 @@ do_setup() (
source "$ENV_FILE" source "$ENV_FILE"
setup_networking "$lsb_dist" "$lsb_version" setup_networking "$lsb_dist" "$lsb_version"
setup_nat
setup_osie setup_osie
generate_certificates generate_certificates
setup_docker_registry setup_docker_registry