LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 08-10-2005, 07:32 AM   #1
statguy
Member
 
Registered: Sep 2004
Location: Ontario, Canada
Distribution: Slackware 14.2, current
Posts: 416

Rep: Reputation: 36
Question What is SFW2-IN-ILL-TARGET and why does it happen even when SuSEfirewall2 is off?


I get tons of messages in my log files that seem to be from SuSEfirewall2. They all have a form similar to:

Code:
Aug 10 08:14:41 rho kernel: SFW2-IN-ILL-TARGET IN=eth0 OUT= MAC= SRC=x.x.x.x DST=y.y.y.y LEN=78 TOS=0x00 PREC=0x00 TTL=64 ID=11 DF PROTO=UDP SPT=137 DPT=137 LEN=58
(Note: I sanitized the SRC and DST IP numbers).

The funny thing is these messages also appear when the firewall is disabled!

What does this message mean and why would it appear with the firewall off?

I want to review the firewall messages for "real" issues but they are swamped with these SFW2-IN-ILL-TARGET messages. I have googled that term but many of the hits are in German.
 
Old 08-10-2005, 08:42 AM   #2
yapp
Member
 
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
I'm not sure about the issue either, but are you sure your firewall is off? maybe you stopped the init script instead of the real thing..?

Try the following:
Code:
iptables -L   # lists all active rules
rcSuSEfirewall2 stop  # easy stop command, an alias for /etc/init.d/SuSEfirewall2_setup
To filter the messages in the firewall, try grep -v e.g:
Code:
grep -v ILL-TARGET /var/log/messages
   or
cat /var/log/messages | grep -v ILL-TARGET

Last edited by yapp; 08-10-2005 at 08:45 AM.
 
Old 08-10-2005, 08:59 AM   #3
statguy
Member
 
Registered: Sep 2004
Location: Ontario, Canada
Distribution: Slackware 14.2, current
Posts: 416

Original Poster
Rep: Reputation: 36
Oops. I used to have the firewall disabled at home. I forgot I re-enabled it.

I would still like to know what the SFW2-IN-ILL-TARGET means however.

I should have mentioned (in case it's relevant) my SuSE version is 9.2.
 
Old 08-10-2005, 09:16 AM   #4
yapp
Member
 
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
Looking at the iptable rules (iptables -L), it appears that the ILL-TARGET is activated after all input chains are skipped.

ILL-TARGET stands for ILLEGAL-TARGET off course.

In other words, the packet didn't match the input ext, int or dmz zones. Maybe you need to adjust the IP settings of those zones?
 
Old 08-10-2005, 09:48 AM   #5
statguy
Member
 
Registered: Sep 2004
Location: Ontario, Canada
Distribution: Slackware 14.2, current
Posts: 416

Original Poster
Rep: Reputation: 36
Thanks. I only have an external interface configured. I confess that the output from iptables -L is almost meaningless to me, but am interested in learning. It would seem there is more configuration present than is obviously accessable from YaST (the firewall module or the sysconfig module).

Is the man page for iptables the best place to start to learn what is going on or can you recommend a better starting place?
 
Old 08-10-2005, 11:51 AM   #6
yapp
Member
 
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
Well, you don't have the be an iptables expert to configure the firewall in SuSE. That's the whole point of the SuSEfirewall script.
I have to agree, if you haven't written any iptable rules yourself, the "iptables -L" output is confusing to say the least.

You can configure the firewall in YaST, or edit /etc/sysconfig/SuSEfirewall2 with a text editor.
I've written my own iptable scripts in the past, but I'm glad SuSEfirewall2 does the job too. It never misses anything

My system sits behind a NAT router, so I only have one interface configured.



Some background on iptables:

How to read the "iptables -L" output:
1. each incoming and outgoing network packet passes through a number of "chains", or "tables".
( there are different types: nat, filter and mangle. the "filter" type does the firewall work)
2. incoming packets start at the "INPUT" chain, outgoing at the "OUTPUT" chain.
3. the packet passes all rules, until one matches.
4. finally, the packet either ends in a "ACCEPT", "DROP" or "REJECT" target.

instead of "iptables -L -v", try "iptables-save", that output is more compact and detailed.

The formatting of the iptables-save output is identical to the parameters passed at the commandline "iptables" program.

The arguments have the following meaning:
-A : append, adds a new rule
-i : defines the incoming network interface the rule applies to
-o : defines the outgoing network interface the rule applies to
-m : passes the packet through a module, often with it's own parameters
-j : jumps to another target or chain (e.g. the input_ext chain, or the ACCEPT target)
the packet returns to the previous chain if none of the rules matched.
-p : defines the network protocol the rule applies to
--dport : defines the network port the rule applies to

As example, the following line adds a new rule to the "input_ext" chain,
all incoming packets received at tcp port 80 (that's http) are accepted.
Code:
iptables -A input_ext -p tcp -m tcp --dport 80 -j ACCEPT

hopefully you'll be able to understand some of the "iptables-save" output now.
If you have any questions, I'd like to know them.
 
Old 08-10-2005, 01:15 PM   #7
statguy
Member
 
Registered: Sep 2004
Location: Ontario, Canada
Distribution: Slackware 14.2, current
Posts: 416

Original Poster
Rep: Reputation: 36
Yapp,

First, thanks for taking the time to write such a helpful reply. If you don't mind, I'd like to see if I am "getting" this. To simplify, I'm just looking at the INPUT chain which is where the ILL_TARGET is coming from. Running the command

iptables-save | grep INPUT

gives the following:

Code:
:INPUT ACCEPT [22557:18120831]
:INPUT DROP [0:0]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -m limit --limit 3/min -j LOG --log-prefix "SFW2-IN-ILL-TARGET " --log-tcp-options --log-ip-options
-A INPUT -j DROP
I don't know what the first two lines mean so will skip them for the moment.

The first rule: "-A INPUT -i lo -j ACCEPT" I read as accepting everything on the loopback interface.

I read the second rule as accpeting packets related to an established connection that I (presumably) have initiated.

Anything else is then logged (third rule) and dropped (fourth rule).

Can I now ask about a couple of the log entries. In what follows, my IP will appear as x.x.x.109 and x.x.x.255 is the Bcast address. Anything else in my subnet will be x.x.x.??? and external will be shown completely.

First:

Code:
Aug 10 13:49:28 rho kernel: SFW2-IN-ILL-TARGET IN=eth0 OUT=
MAC= SRC=x.x.x.109 DST=x.x.x.255 LEN=232
TOS=0x00 PREC=0x00 TTL=64 ID=54 DF PROTO=UDP SP
T=138 DPT=138 LEN=212
So here we have packets being dropped that originate from my machine destined for my Bcast IP (I don't really know what the is).

Second:

Code:
Aug 10 13:59:58 rho kernel: SFW2-IN-ILL-TARGET IN=eth0 OUT=
MAC=ff:ff:ff:ff:ff:ff:00:c0:85:2e:cf:69:08:00 SRC=x.x.x.114
DST=x.x.x.255 LEN=229 TOS=0x00 PREC=0x00 TTL=30 ID=60454
PROTO=UDP SPT=138 DPT=138 LEN=209
Here a packet from a machine in my subnet destined for the Bcast address has been dropped.

Third:

Code:
Aug 10 13:45:22 rho kernel: SFW2-IN-ILL-TARGET IN=eth0 OUT=
MAC=00:0f:b0:69:83:c7:00:e0:52:d8:0c:00:08:00
SRC=205.160.42.65 DST=x.x.x.109 LEN=52 TOS=0x00
PREC=0x00 TTL=11 ID=53411 PROTO=ICMP TYPE=8 CODE=0
ID=40046 SEQ=0
Here, a packet from outside my domain which was destined for my actual IP address has been dropped.

So, if my interpretation is right, the packets destined for the Bcast address as well as my own address are subject to filtering. Is this correct and if so why? Then, can packets destined for x.x.x.255 be safely ignored while packets directed directly at my IP possibly need attention?

Thanks again. I'm learning a lot today!
 
Old 08-10-2005, 04:54 PM   #8
yapp
Member
 
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
Your observations are correct Cool you've picked them up so quickly.
The first two lines can be ignored btw, only the -A lines are important. I assume the others initiate the chains. (which you usually do with iptables -N on the command line) After all, you're looking at an "export" file which iptables-read should be able to "import" somehow.

A broadcast address (ending with 255) is a special address. If a router receives such packet, it forwards it to all other nodes. This allows windows file/printer sharing systems to announce themselves for example.

What you're seeing here is samba (or windows file/printer sharing) trying to communicatie. Ports 137-139 (SPT=source port, DPT=destination port) for both TCP and UDP traffic are used for this. How you can what the port numbers mean..? First there is google, second some technical knowledge, and third there is /etc/services where these are all listed.

The last message (PROTO=ICMP TYPE=8) is an "ICMP type 8" message. With "iptables -L" you'd see the term "echo-request". In other words, you've blocked a standard ping. Sometimes it's unfortunate you need to have this kind of network-knowledge to debug the firewall logs.

I'm surprised you don't have an "input_ext" or "input_int" chain. Have you configured the firewall with YaST once? You can also change /etc/sysconfig/SuSEfirewall2 manually, and set FW_DEV_INT="eth0" (I'm assuming you're behind a ADSL/NAT router here) and restart SuSEfirewall2. Then you can open the ports 137-139 and 445 for TCP and UDP traffic. This allows other systems to connect to your samba servers. (in other words, the shares available on your system).

Cheers!

Last edited by yapp; 08-10-2005 at 05:10 PM.
 
Old 08-10-2005, 06:57 PM   #9
statguy
Member
 
Registered: Sep 2004
Location: Ontario, Canada
Distribution: Slackware 14.2, current
Posts: 416

Original Poster
Rep: Reputation: 36
I do have the input_ext, input_int and input_dmz chains. I just focussed on the INPUT chain for simplicity and because that's where the message I was asking about came from.

I actually am familar with ports 137-9 and 445 because I have explicitly blocked them from LAN to WAN (135-9 actually) on my router. The joys of having an XP box on your network.

Thanks for all the information you've provided. Very helpful and I have learned tons.

Cheers.
 
  


Reply



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
Slack9 got ill after installing Mandrake 10.0 Pier Slackware 2 11-10-2005 04:33 AM
Just a yes or no and ill leave you all alone :) Mistro116@yahoo.com Programming 4 11-07-2005 09:44 AM
2.6? stuff that, ill stay on 2.4 -- just need to know one thing theMonkeY Slackware 6 09-08-2004 04:18 PM
Linux makes me ill ... phoeniXflame Linux - General 11 01-25-2004 06:08 AM
i feel ill AngelLucifer Linux - General 2 11-08-2003 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 06:22 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