ipfw blocks IP address not in table
FreeBSD theranch 10.3-RELEASE-p11 FreeBSD 10.3-RELEASE-p11 #0: Mon Oct 24 18:49:24 UTC 2016 email@example.com:/usr/obj/usr/src/sys/GENERIC 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. 208.xxx.xxx.xxx) 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 126.96.36.199/21 ipfw table 1 add 188.8.131.52/19 ipfw table 1 add 184.108.40.206/20 ipfw table 1 add 220.127.116.11/22 ipfw table 1 add 18.104.22.168/21 ipfw table 1 add 22.214.171.124/21 ipfw table 1 add 126.96.36.199/21 ##ipfw table 1 add 188.8.131.52/21
Using ipfw table 1 list >file and editing that file, here is the proof that IPs starting with 208 are not in the table:
184.108.40.206/18 0 220.127.116.11/20 0 18.104.22.168/32 0 22.214.171.124/20 0 126.96.36.199/16 0 188.8.131.52/20 0 184.108.40.206/23 0 220.127.116.11/23 0 18.104.22.168/22 0
From /var/log/security (with a little sanitizing):
Feb 20 10:04:17 theranch kernel: ipfw: 553 Deny TCP 22.214.171.124:18791 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. 208.xxx.xxx.xxx). Yet my IP is blocked.