Logging from iptables?

General discussion about Gargoyle, OpenWrt or anything else even remotely related to the project

Moderator: Moderators

Post Reply
francolargo
Posts: 1
Joined: Wed Feb 12, 2020 9:22 am

Logging from iptables?

Post by francolargo »

New user here, running a Linksys WRT3200ACM. I am not an expert in Linux, but have had success with past single-board-computer projects by simple trial-and-error. The limited feature set of openWRT is more challenging. I have two questions that are not addressed by anything that searching this forum provides. Thanks in advance for your ideas!

1. I would like to FTP from storage media in a USB port (configured and working). I see that the FTP server 'vsftpd' is installed, however, the setup instructions provided in the openWRT forum are not working. Overall, starting and stopping services via init.d is not working. What am I missing?

2. iptables are new to me but seem quite powerful in controlling router behavior. In particular, I would like to use the LOG feature in iptables to report the forwarding of packets from a range of IPs that use particular destination ports. Specifically, the kid's phones, and chat application ports 5222 and 5223. (homework-time means HOME work!) I have rules in the chain that I think should work, but see nothing in the syslog. Example rule: 'iptables -A forward_tcp_log_chain -p tcp -m iprange --src-range 192.168.1.100-192.168.1.249 --dport 5222:5223 -j LOG --log-prefix "***TCP:" --log-level 1'.
Has anybody used the LOG feature, and where, exactly, should logged information be placed? I wonder if the LOG feature might need some un-installed option...

Again, thanks for any/all ideas or suggestions!

Lantis
Moderator
Posts: 6753
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Logging from iptables?

Post by Lantis »

Gargoyle uses a slightly customised version of vsftpd, so following OpenWrt instructions in this case may not work.
Is there any particular reason you aren't setting this up using the GUI? We have a USB storage plugin which can share via FTP.

Can you provide an entire listing of your iptables rules? Usually via the iptables save command.
Without seeing the full context my thoughts are
- wrong table
- didn't initialise custom chain
- didn't redirect to custom chain
- redirect to custom chain after accept or reject jump.
Please post the output to Pastebin or similar.
The log should be output to the internal log ring buffer, which you can monitor by issuing a "logread -f" to subscribe to it.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply