LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-09-2004, 05:29 AM   #1
Tom.bEE
LQ Newbie
 
Registered: Apr 2004
Distribution: slackware
Posts: 3

Rep: Reputation: 0
iptables & linux 2.6


Hi there!

I've got problems with iptables on the server I set up (slackware current + Linux 2.6.5). I compiled iptables as module. There's no error message, but iptables blocks me out!

It could be related to my rule-set, but I do not think so, because it's very simple:

$iptables -F
$iptables -t nat -F
$iptables -X

$iptables -P INPUT DROP
$iptables -P FORWARD DROP
$iptables -P OUTPUT DROP

$iptables -A INPUT -i lo -j ACCEPT
$iptables -A OUTPUT -o lo -j ACCEPT

$iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
$iptables -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT

$iptables -A OUTPUT -p tcp --sport 1024: --dport 22 -j ACCEPT
$iptables -A INPUT -p tcp --dport 22 -j ACCEPT

This should accept incoming and outgoing ping-Requests (works!!) and ssh-connections (which doesn't work!!)

'iptables -L' shows that the rules have been accepted allright. But I cannot connect to any ssh-server nor connect to my server by any client.

I thought it could be related to kernel 2.6, because I did not use iptables before with linux 2.6. Did I miss any module or config while compiling??

I also did compile iptables 1.29 by myself but the result is the same!!

I'm really helpless now.

Any advice??

thanks a lot,
Thomas
 
Old 04-09-2004, 07:32 AM   #2
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 422Reputation: 422Reputation: 422Reputation: 422Reputation: 422
OK, have you done an iptables -L to see if the rules in operation are what you think they are? Have you run lsmod to make sure that the iptables modules are loaded? In your script you use the variable $iptables. Do you actually define it earlier in the script?
 
Old 04-09-2004, 08:09 AM   #3
Tom.bEE
LQ Newbie
 
Registered: Apr 2004
Distribution: slackware
Posts: 3

Original Poster
Rep: Reputation: 0
hi,

thanks for help, but I got the answer.

It was my rule-set. I forgot these three lines:

$iptables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
$iptables -A OUTPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
$iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT


sorry guys )
 
  


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
iptables & firewall Mibble Linux - Security 1 09-12-2005 01:47 PM
Phục hồi dữ liệu bị mất???, cứ pollsite General 1 06-27-2005 12:39 PM
Samba & IPTABLES & Network Drives Oh My! logicdisaster Linux - Networking 3 06-03-2004 06:07 PM
i want to ask if iptables can do that & if yes how digi_com_lb Linux - Networking 0 04-16-2004 11:05 AM
%&*#&$$ iptables modules Hangdog42 Linux - Newbie 10 03-03-2003 08:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:04 AM.

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