How can I use ipfw (or another tool, if one is available) to allow unlimited access between computers on my LAN, but not allow access to the Internet?
(The IPs on my local LAN are
Has been a while since I've used ipfw but running the following commands on all relevant computers should do the trick:
To disable just run
The crudest way I can think of to do this, assuming your network is based on static IPs, is to just not populate the "Default Gateway" IP in the network configuration.
If you are on a DHCP network, you could change the DHCP server configuration, but that would break the internet access of all computers on the LAN, not just some of them.
As I was looking for an answer to this, I found another way to do it which does not use ipfw. I'll mention it here in case anyone else is looking for a similar answer later.
The other way to do this is to set the DNS servers to 0.0.0.0.
This can accomplished on the command line using
If you have an Ethernet connection, you will want to use
To revert this change, I was able to use 'empty' instead of '0.0.0.0'
but, depending on your network setup, you may need to specify the actual IP address of your DNS servers instead of using
I still think
The reason this works for allowing access to other computers on my LAN is that I can access them using
you can use ipfw to block all traffic to port 80 which is http. You will need to check if you also need to block other ports e.g. 443, 110, 993 etc
From the comment below, did you want to have http access between machines on your network? If so just do above and then add the exception to allow http to machines on your ip range. e.g. /24 if thats what your network is.