LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-07-2003, 06:31 PM   #1
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
closing all and opening specific ports


can anyone give me the commands to close all the ports and open specific ports on the computer? using iptables
 
Old 02-07-2003, 07:36 PM   #2
nxny
Member
 
Registered: May 2002
Location: AK - The last frontier.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771

Rep: Reputation: 30
What time is it?

Time to read the IPTABLES HOWTO.
 
Old 02-08-2003, 11:03 AM   #3
Half_Elf
LQ Guru
 
Registered: Sep 2001
Location: Montreal, Canada
Distribution: Slackware; Debian; Gentoo...
Posts: 2,163

Rep: Reputation: 46
Do you have an iptables scripts? if yes, just put your rules for port you want to open first
(example: $IPTABLES -A INPUT -s 0/0 --dport http -j ACCEPT)
then at the end of your script add a command like :
( $IPTABLES -A INPUT -s/s -j DROP )


iptables uses the first applicable rules it can find, so if there is no rules about "another port" than this one will be use as default.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing Ports Murdock1979 Linux - Security 1 09-23-2005 09:44 AM
opening/closing window sounds matt_com911 Fedora 1 06-18-2005 09:17 PM
Opening/Closing Ports on Debian 3.0 addowen Linux - Newbie 0 04-22-2004 06:43 PM
Closing Ports PionexUser Linux - Newbie 1 07-17-2003 07:55 AM
closing ports im1crazyassmofo Linux - Security 2 01-02-2003 09:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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