In the last post I walked you through a script to create a stateful packet inspection firewall. Which allowed out-going traffic to the internet, but which blocked in-coming traffic. In this part I’m going to explain how to open up specific ports (or holes). To allow certain types of internet traffic successfully through.
As with the earlier articles, there are a few basic parts that rules can be filtered for. These four parts are as follows:
- IP Addresses: a single address (94.76.240.128), or multiple addresses in a range (94.76.240.128-150)
- Interface: eth1,ppp0,wlan0 (these are usually names of physical network ports on your computer)
- Ports: a single port (http 80) or a range of ports
- Protocols: icmp, tcp, udp, all



