How to Build an IPFW on FreeBSD 4.x
First of all, you need to view the Current Kernel options.
And see whether the Following lines exist
If they doesn’t exist, you need to add these options and recompile the kernel.
This is how to configure and compile your kernel.
(or whatever you want to name it to)
Add the following config options:
Save and exit.
Now, the new Kernel should have been configured.
IF YOU ARE SETTING THIS UP OVER SSH (REMOTE) DO NOT RESTART YOUR MACHNE YET, OTHERWISE YOU WILL LOCK YOURSELF OUT!!!
To setup the firewall on your machine, you need to add some options onto /etc/rc.conf
At the moment its set to DENY, so you need to add some allow Rules etc etc.
Before you change your rc.conf, I suggest you make a backup copy of it.
Now edit /etc/rc.conf and add the following lines:
Now, save the rc.conf
Final Step is to create the firewall script ipfw.rules and place it in /etc Directory.
On the Firewall Rules (see below) , I have added 2 Rules where It will allow A certain IP to access the Machine no matter what. So, Replace the IP 220.127.116.11 With your Static IP.
NOTE: sis0 is the machine’s interface. You need to change it to YOUR machine’s interface. Just do ifconfig on the terminal and It will tell you what its called. THIS IS VERY IMPORTANT.
When you Reboot Your Machine You should have a working Firewall!!!