Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#178232 - 07/09/2003 23:04 iptables Logging
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
I have several ports on my linux firewall mapped to internal machines, and I'd like to log traffic to these devices. So far, I haven't had much luck. Here is one of the lines in my ipmasq script that forwards a port:

/usr/sbin/iptables -A PREROUTING -t nat -p tcp -d $extip --dport 6112 -j DNAT --to 192.168.0.10:6112

I've tried iptables -A PREROUTING -t nat -v -d 192.168.0.0/24 -j LOG --log-prefix="nat PREROUTING:" but that dosen't seem to be it, as I can telnet to one of the forwarded ports (from a box outside my network), and nothing shows in the logs.

Top
#178233 - 08/09/2003 07:40 Re: iptables Logging [Re: drakino]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Try this sequence:

/usr/sbin/iptables -A PREROUTING -t nat -p tcp -d $extip --dport 6112 -j LOG --to 192.168.0.10:6112
/usr/sbin/iptables -A PREROUTING -t nat -p tcp -d $extip --dport 6112 -j DNAT --to 192.168.0.10:6112

Top
#178234 - 08/09/2003 07:43 Re: iptables Logging [Re: mlord]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
And also try "ipchains --log-level=0" to ensure the messages show up, regardless of your default log settings.

Cheers

Top