this is how it is done:
do this on the maas/region cluster controller. this only for those who have maas/region cluster running on one server.
sudo nano nat.sh
then: copy and paste the contents of the link:
save file nat.sh
After configuring the 2 variables, if necessary, ( i found it not necessary)
save the script below as nat.sh and make it executable by doing
chmod a+x nat.sh
Now, test the script by running as root
sudo sh nat.sh
Investigate the messages from the console output to see if any error happened. If everything looks fine, use another host in the internal network to test if it can access the external network (presumably the Internet). A quick way to test is pinging Google public DNS from the console.
ping -c 3 -W 10 188.8.131.52
If ping responds, make our new script bootable so we don't have to run the script every time we restart.
sudo cp nat.sh /etc/init.d/
sudo ln -s /etc/init.d/nat.sh /etc/rc2.d/S95masquradescript
As a final test, restart your computer and test to see if you still have the same functionality. If so then congratulations! If not then make sure you followed the above correctly so the script is bootable.
it worked beautifully. test by plugging a laptop on the node side of you router, and you should have internet.