[SOLVED] iptables logging inside LXC containers

Michael B

Member
Jan 12, 2016
4
1
6
38
Hi everyone,

First of all, after many years of use, I wanted to thanks the whole team behind Proxmox VE for the amazing work!

I'm now since a few months a happy user of Proxmox VE 4 and it's LXC containers.

However, I've lately been facing issues with firewall logging: I am using custom iptables configuration scripts, and it took me some time and online research to find out I should use NFLOG target (not LOG), to get logs in /var/log/pve-firewall.log.

What now works great on the host side doesn't give any result inside LXC containers. For instance, the following rule wont log anything, either on guest or host side:

iptables -A INPUT -p tcp -j NFLOG --nflog-prefix "iptables from lxc "

Is there some specific configuration I should do to get this working?

Thanks in advance for your help!
 
Okay, after more hours of searching, I found out that ulogd2 (which does the same job as pvefw-logger) has to be installed (and running) in each LXC container where you'd like to log iptables packets ...

Resulting logs will be available in /var/log/ulog/syslogemu.log
 
  • Like
Reactions: jsabater

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!