Results 1 to 4 of 4

Thread: Change iptables log in 9.10

  1. #1
    Join Date
    Nov 2006
    Location
    UK
    Beans
    391
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Question Change iptables log in 9.10

    Hi,

    How can i change the log location for Iptables pls in 9.10? 9.10 uses rsyslog now I believe.

    http://www.cyberciti.biz/tips/force-...-log-file.html

    but thats for syslog.conf instead of rsyslog.

    THanks

  2. #2
    Join Date
    Nov 2006
    Location
    UK
    Beans
    391
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Change iptables log in 9.10

    Hi,

    Found this

    http://blog.shadypixel.com/log-iptab...-with-rsyslog/

    And so have created

    cat iptables.conf which has

    Code:
    :msg, startswith, "iptables denied: " -/var/log/iptables.log
    & ~
    However items are still getting logged to messages not /var/log/iptables.log

    These are the iptables.rules being restored via iptables-restore - any ideas please?

    Code:
    # Generated by iptables-save v1.4.1.1 on Wed Jul 15 15:26:08 2009
    *filter
    :INPUT DROP [712:79941]
    :FORWARD DROP [0:0]
    :OUTPUT ACCEPT [142245:17267585]
    :allowed - [0:0]
    :existing-connections - [0:0]
    -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 4 
    -A INPUT -j existing-connections 
    -A INPUT -j allowed 
    -A existing-connections -i lo -j ACCEPT 
    -A existing-connections -m state --state ESTABLISHED -j ACCEPT 
    -A existing-connections -m state --state RELATED -j ACCEPT 
    COMMIT
    # Completed on Wed Jul 15 15:26:08 2009
    # Generated by iptables-save v1.4.1.1 on Wed Jul 15 15:26:08 2009
    *mangle
    :PREROUTING ACCEPT [181100:209038881]
    :INPUT ACCEPT [174949:207323062]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [142245:17267585]
    :POSTROUTING ACCEPT [142254:17270190]
    COMMIT
    # Completed on Wed Jul 15 15:26:08 2009

  3. #3
    Join Date
    Nov 2006
    Location
    UK
    Beans
    391
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: Change iptables log in 9.10

    Fixed it - FYI added

    Code:
    :msg,contains,"iptables" /var/log/iptables.log
    & ~
    *.info;mail.none;authpriv.none;cron.none /var/log/messages
    to /etc/rsyslog.d/50-default.conf

    Allows for only iptables alerts to be affected.

  4. #4
    Join Date
    Jun 2010
    Beans
    1

    Angry Re: Change iptables log in 9.10

    Quote Originally Posted by yeleek View Post
    Fixed it - FYI added

    Code:
    :msg,contains,"iptables" /var/log/iptables.log
    & ~
    *.info;mail.none;authpriv.none;cron.none /var/log/messages
    to /etc/rsyslog.d/50-default.conf

    Allows for only iptables alerts to be affected.
    Can I change the alerts level to lower level like debug ?( My system is ubuntu 10.04 )

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •