LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 05-12-2003, 04:16 PM   #1
C8H10N4O2
Member
 
Registered: Dec 2002
Location: Australia
Distribution: SuSE, Vector Linux
Posts: 51

Rep: Reputation: 15
iptables and RedHat 8


I'm running RedHat 8.0. I scanned my system with nmap and I found a few open ports (only 3 which surprised me). Obviously I wanted them closed, but it seems “iptables” is not a valid command. I thought that maybe it wasn't installed, so I found an RPM package for it and gave that a try, but it told me it was already installed.

Then I entered “/sbin/iptables” and I got the error message.

iptables v1.2.6a: no command specified
Try `iptables -h' or 'iptables --help' for more information.

I tried to close the port by typing “/sbin/iptables -A INPUT -p tcp --dport <port number> -j REJECT

I received no feedback, but no error messages either so I thought it may have worked. But then another nmap scan showed the port still open.

I'm very much a newbie to this, can anybody suggest what I might be doing wrong? Thank you.
 
Old 05-12-2003, 05:15 PM   #2
jetblackz
Member
 
Registered: Mar 2002
Location: Debian Galaxy
Distribution: Debian
Posts: 711

Rep: Reputation: 30
Find out where it is:

whereis iptables

or

find / -name iptables*
 
Old 05-12-2003, 05:19 PM   #3
C8H10N4O2
Member
 
Registered: Dec 2002
Location: Australia
Distribution: SuSE, Vector Linux
Posts: 51

Original Poster
Rep: Reputation: 15
whereis iptables returned...

iptables: /sbin/iptables /lib/iptables /usr/share/man/man8/iptables.8.gz
 
Old 05-13-2003, 02:32 PM   #4
jetblackz
Member
 
Registered: Mar 2002
Location: Debian Galaxy
Distribution: Debian
Posts: 711

Rep: Reputation: 30
No response is the right response. Did you try iptables --help?

I think it took your parameters. Do

iptables -xnvL
 
Old 05-13-2003, 08:42 PM   #5
nakkaya
LQ Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
http://firestarter.sourceforge.net/

download it it is a iptables wrapper easy to use and effective
 
Old 05-14-2003, 08:48 AM   #6
C8H10N4O2
Member
 
Registered: Dec 2002
Location: Australia
Distribution: SuSE, Vector Linux
Posts: 51

Original Poster
Rep: Reputation: 15
Yeah I tried the help, any command beginning in "iptables" simply complains that it's unknown command.

I'll give that wrapper a try as soon as I get back home. Thanks.
 
Old 05-14-2003, 12:07 PM   #7
jetblackz
Member
 
Registered: Mar 2002
Location: Debian Galaxy
Distribution: Debian
Posts: 711

Rep: Reputation: 30
Then iptables is either not installed or not in path.

find / -name iptables*

If nothing turns up, reinstall it through Control Center as root.
 
Old 05-14-2003, 12:16 PM   #8
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Well you have to be root to use iptables and they must be in your path:

echo $PATH

If you don't see /sbin then its not in your path. Try specifying the whole path to the command:

/sbin/iptables -L
 
Old 05-14-2003, 03:08 PM   #9
C8H10N4O2
Member
 
Registered: Dec 2002
Location: Australia
Distribution: SuSE, Vector Linux
Posts: 51

Original Poster
Rep: Reputation: 15
Yeah it works when I use the whole path (as I did above when trying to close the ports) just not alone, and the help files tell me to do exactly what I did, which didn't work. Anyway I'm about to give that wrapper a try now. I'll edit this post and say how it went.

Well it doesn't work really, the ports are still open. I give up though, I was able to configure it perfectly easily on my main partition (Vector Linux). RedHat is just installed on spare space that I use for trying every distro I can get my hands on anyway. I'm somewhat of a Linux whore.

Last edited by C8H10N4O2; 05-14-2003 at 03:32 PM.
 
Old 05-22-2003, 05:10 PM   #10
gruger
Member
 
Registered: May 2003
Location: Belgium
Distribution: RedHat 8.0
Posts: 51

Rep: Reputation: 15
do the trick

Just try

iptables -A INPUT -p tcp --dport [open port] -j REJECT

This shut work also

iptables -A INPUT -p tcp --dport [open port] -j DROP
 
  


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
Learning IPTables on RedHat 9 fazzy Linux - Security 2 11-02-2004 09:28 AM
insmod for iptables for Redhat Linux 9.0 yuva_mca Linux - Security 3 03-08-2004 07:24 PM
Redhat 9.0 and IPTables Problems ordoz Linux - Security 3 11-14-2003 10:30 AM
Redhat 9, sendmail, iptables TomServo3k Linux - Networking 5 07-01-2003 03:09 PM
iptables - getting error in redhat 7.1 ForumKid Linux - Security 1 12-31-2001 04:31 PM

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

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