Skip to contentSkip to conversation

/proc/net/netfilter/nf_log boot setup / persistence

DISCUSSION oatech 2 participants 4 messages Apr 6, 2014 – Apr 9, 2014 1 message not in the archive

lore
Share & tools
lore

oatech

author
#1 lore raw
In reply to a message not in the archive

Hi

I manage to change the /proc/net/netfilter/nf_log flags using echo > /process/sys/netfilter/nf_log/ ...
( For IPv6 nflogging )

But it gets deleted at reboot.
Worse, using a boot-time script fails ( the flags get overwritten ) Using /etc/sysctl.conf doesn't seem to work.

I end up using a 1minute cron job that rewrites the flags each minute.

Is there a better way ? Or a sysctl.conf kind config file ?

Thanks :-)

---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com

#2 lore raw

Bonjour,

Quoted 10 lines · oatech

Hi

I manage to change the /proc/net/netfilter/nf_log flags using echo > /process/sys/netfilter/nf_log/ ...
( For IPv6 nflogging )

But it gets deleted at reboot.
Worse, using a boot-time script fails ( the flags get overwritten ) Using /etc/sysctl.conf doesn't seem to work.

I fear your firewall script is running after sysctl.conf settings are installed. Usually the firewall script is triggering the loading of logging modules.

Quoted 3 lines

I end up using a 1minute cron job that rewrites the flags each minute.

Is there a better way ? Or a sysctl.conf kind config file ?

The most handy way can be to load the Netfilter modules at start For example by putting them in /etc/modules (at least for debian). Then when sysctl settings will be evaluated you should get a working config.

Quoted 1 line

Thanks :-)

You're welcome (if my suggestion works) ;)

BR,

Signature · 1 line
Eric Leblond <[email protected]>
author
#3 lore raw
Quoted 30 lines

Subject: Re: /proc/net/netfilter/nf_log boot setup / persistence

Bonjour,

Quoted 10 lines · oatech

Hi

I manage to change the /proc/net/netfilter/nf_log flags using echo > /process/sys/netfilter/nf_log/ ...
( For IPv6 nflogging )

But it gets deleted at reboot.
Worse, using a boot-time script fails ( the flags get overwritten ) Using /etc/sysctl.conf doesn't seem to work.

I fear your firewall script is running after sysctl.conf settings are installed. Usually the firewall script is triggering the loading of logging modules.

Quoted 3 lines

I end up using a 1minute cron job that rewrites the flags each minute.

Is there a better way ? Or a sysctl.conf kind config file ?

The most handy way can be to load the Netfilter modules at start For example by putting them in /etc/modules (at least for debian). Then when sysctl settings will be evaluated you should get a working config.

Quoted 7 lines
Quoted 1 line

Thanks :-)

You're welcome (if my suggestion works) ;)

BR,

Signature · 1 line
Eric . <eric@.>

Hi

Thanks for the answer
I'm not a Linux Sysadmin ( I'm a network admin mostly, just using Linux networking daemons for learning ) so I tried
your suggestion but got confused.
I'm Using Ubuntu Trusty Beta ( almost Debian so ).
I did found /etc/modules and try to play with it, but just managed to breack the whole nflog thing : cat .../netfilter/nflog went totally emptied.
Did reinstall thus ..

Please could someone help me precise what would need to be :
1) in /etc/modules
2) in the firewall start script ( just the main lines ... some modprobes maybe ?
....)

Thanks

---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active.
http://www.avast.com

#4 lore raw

Hello,

Quoted 49 lines · oatech
Quoted 29 lines

Subject: Re: /proc/net/netfilter/nf_log boot setup / persistence

Bonjour,

Quoted 10 lines · oatech

Hi

I manage to change the /proc/net/netfilter/nf_log flags using echo > /process/sys/netfilter/nf_log/ ...
( For IPv6 nflogging )

But it gets deleted at reboot.
Worse, using a boot-time script fails ( the flags get overwritten ) Using /etc/sysctl.conf doesn't seem to work.

I fear your firewall script is running after sysctl.conf settings are installed. Usually the firewall script is triggering the loading of logging modules.

Quoted 3 lines

I end up using a 1minute cron job that rewrites the flags each minute.

Is there a better way ? Or a sysctl.conf kind config file ?

The most handy way can be to load the Netfilter modules at start For example by putting them in /etc/modules (at least for debian). Then when sysctl settings will be evaluated you should get a working config.

Quoted 7 lines
Quoted 1 line

Thanks :-)

You're welcome (if my suggestion works) ;)

BR,

Signature · 1 line
Eric . <eric@.>

Hi

Thanks for the answer
I'm not a Linux Sysadmin ( I'm a network admin mostly, just using Linux networking daemons for learning ) so I tried
your suggestion but got confused.
I'm Using Ubuntu Trusty Beta ( almost Debian so ).
I did found /etc/modules and try to play with it, but just managed to breack the whole nflog thing : cat .../netfilter/nflog went totally emptied.
Did reinstall thus ..

Quoted 2 lines

Please could someone help me precise what would need to be :
1) in /etc/modules

You should add to that file:

xt_NFLOG
xt_LOG

Second line being needed if you use -j LOG target.

Quoted 3 lines

2) in the firewall start script ( just the main lines ... some modprobes maybe ?
....)

Here you can add at top modprobe of previously mentioned modules. And do the sysctl tuning as following step.

BR,

Signature · 1 line
Eric Leblond <[email protected]>