harshdevx.com | infotech & infosec articles | tutorials | analytics
ubuntu as your gateway
i can't thanks linux enough. a year back around same time i was struggling with what to use as my firewall. i did alot of experimentation with routers installed dd-wrt/openwrt/tomato actually fried two routers. finally settled with a $80 refurbished desktop from hp (sff) and converted into firewall. so this tutorial is about how to make a firewall spending as little money as possible. many of us have a spare machine old one thats lying around and sometimes we basically throw it because its too slow running windows on. my advise don't throw. what i did was i got this machine installed a $20 gbps nic (network interface card) and installed ubuntu 14.04 server (i went with a mini iso). i will not cover how to install ubuntu server on a machine as there are plenty of tutorials and you can basically get this running within like 20 mins. there are plenty of tutorials available on firewalls as well. i just thought of covering them here was because at one time i was too scared with iptables. but after working with iptables for a year now i can say i am doing ok. this tutorial will get you started with your home firewall.
step 1: get the ubuntu 14.04/16.04 installed. now you can go with any of the distro you like ubuntu is my choice just to make few things easy.
chmod +x /admin/scripts/fwall <-- this basically makes the file executable
next we will write some code. this code will basically ensure that data from your LAN interface is sent to the WAN interface of firewall and vice versa. to download the code below click me and save as .sh. do not forget to make it executable.
once we are through with our firewall we will have to configure the router to pass the traffic from our LAN to the firewall.
concept and design: harshdevX