ipfw blocks IP address not in table

uname -a FreeBSD theranch 10.3-RELEASE-p11 FreeBSD 10.3-RELEASE-p11 #0: Mon Oct 24 18:49:24 UTC 2016 amd64

Here is the situation. I am using IPFW to block ranges of IPs from accessing email ports other than 25. (Port 25 is needed for incoming mail). I’m blocking all the IMAP and POP ports using several tables I have created. The particular problem is with IPFW table 1 that I create with a shell script. Occasionally my IP address starts with 208 (i.e. and the table blocks it EVEN though my IP is not contained in the table.

As a test, I comments out any line that puts an IP starting with 208 in the table. For example

#joes datacenter
ipfw table 1 add
ipfw table 1 add
ipfw table 1 add
ipfw table 1 add
ipfw table 1 add
ipfw table 1 add
ipfw table 1 add
##ipfw table 1 add

Using ipfw table 1 list >file and editing that file, here is the proof that IPs starting with 208 are not in the table: 0 0 0 0 0 0 0 0 0

From /var/log/security (with a little sanitizing):

Feb 20 10:04:17 theranch kernel: ipfw: 553 Deny TCP mydoip.198:143 in via vtnet0

Here is the relevant rc.firewall line that creates rule 553:

00553 deny log ip from table(1) to any dst-port 143

In summary, I have shown that there are no entries in ipfw table 1 that start with 208 (i.e. Yet my IP is blocked.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Solved. I found a line where I had no value after the slash in the CIDR.

Visually ipfw table 1 add instead of ipfw table 1 add

This is just an example. The bug was on a different line. I suppose ipfw has an undefined behavior with that typo.