You have to tell the iptables rule to actually log somewhere. The default location will be /var/log/messages.
You can modify this by adding a line like this to the /etc/syslog.conf file:
| kern.warning -/var/log/firewall |
Restart syslog for this change to take effect:
# /etc/init.d/syslog restart
Shutting down kernel logger: [PASSED]
Shutting down system logger: [ OK ]
Starting system logger: [FAILED]
Starting kernel logger: [PASSED]
|
Then, you can setup your firewall rules, but still have to tell which ones to actually log. For example:
iptables -I INPUT -p tcp --dport 21 -j LOG
iptables -I INPUT -p tcp --dport 21 -j ACCEPT |
This will log all packets that match for FTP traffic, and the 2nd rule lets the traffic in. If you receive this error:
# iptables -I INPUT -p tcp --dport 21 -j LOG
iptables: No chain/target/match by that name |
It means it won't work. I haven't seen anyone specifically ask about this before, so I honestly don't know if the necessary libraries for iptables for logging are installed and activated on the FC4 VPSs.