LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 03-20-2006, 08:45 AM   #1
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Rep: Reputation: 31
iptables: not understanding a specific line.


Hi!

I got to see an ipables'configuration and coundn't understand the following line:
Quote:
REJECT all -- anywhere anywhere reject-with
Could anyone explain me what it means?

Thanks.
 
Old 03-20-2006, 01:35 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
it's your basic REJECT rule... it would be much clearer if you would look at (or post) the actual rule from your iptables script...

Last edited by win32sux; 03-20-2006 at 01:36 PM.
 
Old 03-20-2006, 03:24 PM   #3
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by win32sux
it's your basic REJECT rule... it would be much clearer if you would look at (or post) the actual rule from your iptables script...
Hier is my iptables
Quote:
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT ipv6-crypt-- anywhere anywhere
ACCEPT ipv6-auth-- anywhere anywhere
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:5353
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:8000
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Is
Quote:
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
like policy REJECT, or is there a difference?
And what does
Quote:
RH-Firewall-1-INPUT
mean actually?

Thanks.
 
Old 03-20-2006, 07:51 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by xpucto
Is like policy REJECT, or is there a difference?
there is a difference... basically you don't wanna use a "catch-all" rule at the end of the chain, you wanna instead set the right policy for the chain, because that's what the policies are there for... so practically speaking, you should set your INPUT policy to DROP (i suggest DROP instead of REJECT) and remove that REJECT rule...

Quote:
And what does RH-Firewall-1-INPUT mean actually?
it's a user-created chain... according to what you posted, it's referenced twice... looks like once from the INPUT chain and once from the FORWARD chain...

the setup is not so clear by what you posted, try adding the "-v" option the "iptables -L" command to get a better view:
Code:
iptables -L -v
and also:
Code:
iptables -L -v -t nat
is this box a gateway/firewall/router or is it a regular client PC??
 
Old 03-21-2006, 07:18 AM   #5
xpucto
Member
 
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Original Poster
Rep: Reputation: 31
Quote:
sudo /sbin/iptables -L -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
27M 5358M RH-Firewall-1-INPUT all -- any any anywhere anywhere

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 RH-Firewall-1-INPUT all -- any any anywhere anywhere

Chain OUTPUT (policy ACCEPT 53M packets, 60G bytes)
pkts bytes target prot opt in out source destination

Chain RH-Firewall-1-INPUT (2 references)
pkts bytes target prot opt in out source destination
958K 318M ACCEPT all -- lo any anywhere anywhere
11582 1379K ACCEPT icmp -- any any anywhere anywhere icmp any
0 0 ACCEPT ipv6-crypt-- any any anywhere anywhere
0 0 ACCEPT ipv6-auth-- any any anywhere anywhere
11 1141 ACCEPT udp -- any any anywhere 224.0.0.251 udp dpt:5353
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:ipp
26M 5004M ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
258K 13M ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:http
35 1912 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:8000
12 648 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:https
4284 256K ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh
266 14010 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:smtp
373K 22M REJECT all -- any any anywhere anywhere reject-with icmp-host-prohibited
Quote:
sudo /sbin/iptables -L -v -t nat
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

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

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
What does it tell us new? The firewall is for a webserver.
I still didn't understand the meaning and function of
Quote:
RH-Firewall-1-INPUT
. If it's a user-created chain, where may I read what's in it?
 
Old 03-21-2006, 03:14 PM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by xpucto
If it's a user-created chain, where may I read what's in it?
it's this part of what you posted:
Code:
Chain RH-Firewall-1-INPUT (2 references)
pkts bytes target prot opt in out source destination
958K 318M ACCEPT all -- lo any anywhere anywhere
11582 1379K ACCEPT icmp -- any any anywhere anywhere icmp any
0 0 ACCEPT ipv6-crypt-- any any anywhere anywhere
0 0 ACCEPT ipv6-auth-- any any anywhere anywhere
11 1141 ACCEPT udp -- any any anywhere 224.0.0.251 udp dpt:5353
0 0 ACCEPT udp -- any any anywhere anywhere udp dpt:ipp
26M 5004M ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
258K 13M ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:http
35 1912 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:8000
12 648 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:https
4284 256K ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:ssh
266 14010 ACCEPT tcp -- any any anywhere anywhere state NEW tcp dpt:smtp
373K 22M REJECT all -- any any anywhere anywhere reject-with icmp-host-prohibited
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
help me understanding iptables logs ddaas Linux - Security 1 02-23-2005 09:08 AM
understanding iptables gr00ve Linux - Networking 1 11-01-2004 12:47 PM
Understanding iptables Buckyjunior Linux - Networking 3 03-07-2004 06:18 AM
burning cdrs using cdrecord (ver2.0) from the command line (understanding) hamster Linux - General 2 05-13-2003 06:38 PM
Printing a specific line charlie123 Linux - Newbie 2 02-10-2003 10:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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