LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Closed Thread
  Search this Thread
Old 01-22-2013, 08:18 PM   #1
cr-atlanta
LQ Newbie
 
Registered: Jan 2013
Location: Atlanta, GA, USA
Distribution: Gentoo, OSX
Posts: 18

Rep: Reputation: Disabled
iptables not logging - Gentoo, 3.5.7 kernel


Hi everybody,

So I know that "iptables not logging" is a prettty frequent post - I've tried to diagnose this ad nauseam with no avail - so I'm sorry for adding yet one more post about iptables not logging to the internet.

I have a simple server setup - Apache, vsFTPd, and MySQL. I have rigged iptables, successfully, to allow connections to those services and drop all others - I just can't get it to log the dropped, or any other, connections. Syslog-ng is working well, from what I can tell - and my configuration is pretty simple, so I can't figure out what is going on. I would be delighted if somebody can shed some light on my situation. My understanding is that my configuration will log all dropped connections. Here's some relevant commands:

Code:
gentoo / # ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.1.201  netmask 255.255.255.0  broadcast 10.0.1.255
        inet6 fe80::21c:42ff:fe2a:82c8  prefixlen 64  scopeid 0x20<link>
        ether 00:1c:42:2a:82:c8  txqueuelen 1000  (Ethernet)
        RX packets 5768  bytes 697118 (680.7 KiB)
        RX errors 0  dropped 9  overruns 0  frame 0
        TX packets 2504  bytes 438728 (428.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 12  bytes 720 (720.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 720 (720.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


gentoo / # /etc/init.d/syslog-ng restart
 * Stopping syslog-ng ...                                                                                                                                                                                                               [ ok ]
 * Starting syslog-ng ...                                                                                                                                                                                                               [ ok ]


gentoo / # /etc/init.d/iptables restart
 * WARNING: you are stopping a boot service
 * Saving iptables state ...                                                                                                                                                                                                            [ ok ]
 * Stopping firewall ...                                                                                                                                                                                                                [ ok ]
 * Loading iptables state and starting firewall ...                                                                                                                                                                                     [ ok ]


gentoo / # iptables -L -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
   14   892 ACCEPT     all  --  lo     any     anywhere             anywhere            
 8361  627K ACCEPT     all  --  any    any     anywhere             anywhere             ctstate RELATED,ESTABLISHED
    1    52 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:http
    3   228 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ssh
   12   768 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:ftp
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere             tcp dpt:mysql
  254 17258 DROP       all  --  any    any     anywhere             anywhere            
    0     0 LOG        all  --  any    any     anywhere             anywhere             LOG level warning

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 178 packets, 21032 bytes)
 pkts bytes target     prot opt in     out     source               destination         


gentoo / # tail /var/log/messages 
Jan 22 21:02:29 localhost syslog-ng[12756]: syslog-ng starting up; version='3.2.5'
Jan 22 21:02:35 localhost syslog-ng[12756]: Termination requested via signal, terminating;
Jan 22 21:02:35 localhost syslog-ng[12756]: syslog-ng shutting down; version='3.2.5'
Jan 22 21:02:36 localhost syslog-ng[12786]: syslog-ng starting up; version='3.2.5'
Jan 22 21:02:39 localhost /etc/init.d/iptables[12789]: WARNING: you are stopping a boot service
Jan 22 21:05:50 localhost /etc/init.d/iptables[12841]: WARNING: you are stopping a boot service
Jan 22 21:09:23 localhost syslog-ng[12786]: Termination requested via signal, terminating;
Jan 22 21:09:23 localhost syslog-ng[12786]: syslog-ng shutting down; version='3.2.5'
Jan 22 21:09:24 localhost syslog-ng[12937]: syslog-ng starting up; version='3.2.5'
Jan 22 21:09:31 localhost /etc/init.d/iptables[12940]: WARNING: you are stopping a boot service

charles$ telnet 10.0.1.201 81
Trying 10.0.1.201...
telnet: connect to address 10.0.1.201: Operation timed out
telnet: Unable to connect to remote host
(this command of from another machine)

gentoo / # tail /var/log/messages 
Jan 22 21:02:35 localhost syslog-ng[12756]: Termination requested via signal, terminating;
Jan 22 21:02:35 localhost syslog-ng[12756]: syslog-ng shutting down; version='3.2.5'
Jan 22 21:02:36 localhost syslog-ng[12786]: syslog-ng starting up; version='3.2.5'
Jan 22 21:02:39 localhost /etc/init.d/iptables[12789]: WARNING: you are stopping a boot service
Jan 22 21:05:50 localhost /etc/init.d/iptables[12841]: WARNING: you are stopping a boot service
Jan 22 21:09:23 localhost syslog-ng[12786]: Termination requested via signal, terminating;
Jan 22 21:09:23 localhost syslog-ng[12786]: syslog-ng shutting down; version='3.2.5'
Jan 22 21:09:24 localhost syslog-ng[12937]: syslog-ng starting up; version='3.2.5'
Jan 22 21:09:31 localhost /etc/init.d/iptables[12940]: WARNING: you are stopping a boot service
Jan 22 21:10:01 localhost cron[12978]: (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons)
So here I am just refreshing syslog and iptables, showing my config, then connecting from another machine (actually the same physical machine, my Gentoo install is on a VM with a separate IP address), and showing that /var/log/messages is the same.

I'm so confused - can anybody point me in the right direction?

Thank you very much!
 
Old 01-23-2013, 08:28 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by cr-atlanta View Post
Thank you very much!
Yes, and thank you for not cross-posting threads.

Post your thread once and in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread should be closed because it is a duplicate of http://www.linuxquestions.org/questi...el-4175446824/.
 
  


Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables logging saavik Linux - Networking 5 09-13-2007 01:49 AM
Iptables logging and the kernel-smp tomsand Fedora 0 05-16-2006 06:13 PM
problem logging in on gentoo Anjar Linux - Newbie 6 04-27-2006 09:00 AM
iptables logging laotalax Linux - Networking 1 10-25-2005 09:55 AM
iptables logging zsoltrenyi Linux - Software 1 08-19-2004 10:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 06:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration