3 source /etc/default/snf-network
7 if [ ! -e $STATE_DIR/infra ]; then
8 echo No infra file found!
9 echo run: snf-network-build-node-infra
13 source $STATE_DIR/infra
16 echo "Usage: $0 <masq bridge> <subnet> <gateway>"
20 #TODO include this in infra file
26 NETMASK=$(ipcalc $SUBNET | grep Netmask | awk '{print $4}')
28 ip addr add $GATEWAY/$NETMASK dev $MASQ_BRIDGE
29 iptables -t nat -A POSTROUTING -s $SUBNET \! -d $SUBNET -j MASQUERADE