IPFW IPFW - TABLE Deprecated

I am updating some firewall rules to work with fail2ban, and when I set to create the table on boot process I got this message:

Code:
DEPRECATED: inserting data into non-existent table 1. (auto-created)

My /etc/ipfw.rules of this part:

Code:
...
ipfw -q add 01500 check-state

# fail2ban IPs
ipfw table 1 flush
ipfw table 1 add 127.0.0.2
ipfw add 1 deny ip from "table(1)" to me

...

Theres an way to fix the warning?

Something like:

Code:
If ipfw "table(1)" does not exist
Create
Else
flush

Then

ipfw table 1 add 127.0.0.2
ipfw add 1 deny ip from "table(1)" to me
 
From the manpage ipfw()...: "Tables require explicit creation via create before use."

Code:
DEPRECATED: inserting data into non-existent table 1. (auto-created)
This indicates that the table does not exist when adding rules to it and it has been auto-created when you added your first entry in the table (that did not exist before).
You should add an explicit create command to create the table before flushing or adding entries to it.
Code:
# fail2ban IPs
ipfw table 1 create
ipfw table 1 flush
ipfw table 1 add 127.0.0.2
 
Code:
# fail2ban IPs
ipfw table 1 create
ipfw table 1 flush
ipfw table 1 add 127.0.0.2

This works perfectly at boottime, by the way, restarting the service:

service ipfw restart

Says the table already exists instead restart without messages.

Looking the ipfw()... I have no found how to check if the table already exists using an IF for example.
 
ipfw(8) tables since FreeBSD 11 come with extra facilities, for example arbitrary table-names. The legacy table numbering is still supported for backward compatibility.
 
Back
Top