Fix NAT and make it working for Terraform and Vagrant
Commit b504810
introduced a NAT to make worker capable of reaching the
public internet via the provisioner.
But it also introduced a bug, it only works for the Vagrant setup as
Manny pointed out:
https://github.com/tinkerbell/sandbox/pull/33#issuecomment-759651035
This is an attempt to fix it
Signed-off-by: Gianluca Arbezzano <gianarb92@gmail.com>
This commit is contained in:
@ -63,6 +63,12 @@ configure_vagrant_user() (
|
||||
--password-stdin "$TINKERBELL_HOST_IP"
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
main() (
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
@ -91,6 +97,8 @@ main() (
|
||||
|
||||
./setup.sh
|
||||
|
||||
setup_nat
|
||||
|
||||
secure_certs
|
||||
|
||||
configure_vagrant_user
|
||||
|
Reference in New Issue
Block a user