IPFW IPFW - TABLE Deprecated

wisdown

Active Member

Reaction score: 12
Messages: 129

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
 

Duffyx

Active Member

Reaction score: 38
Messages: 102

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
 
OP
OP
W

wisdown

Active Member

Reaction score: 12
Messages: 129

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.
 
Top