Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion nodes/aws/configs/node_setup.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#! /bin/bash
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
DEFAULTETH=`ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//"`
sudo iptables -t nat -A POSTROUTING -o $DEFAULTETH -j MASQUERADE
5 changes: 3 additions & 2 deletions setup/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ echo "50 loadb" >> /etc/iproute2/rt_tables
# set rule for openvpn client source network to use the second routing table
ip rule add from 10.10.10.0/24 table loadb

# always snat from eth0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# always snat from default ethernet
DEFAULTETH=`ip route | grep default | sed -e "s/^.*dev.//" -e "s/.proto.*//"`
iptables -t nat -A POSTROUTING -o $DEFAULTETH -j MASQUERADE

############################
# post install instructions
Expand Down