Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-01-2003, 07:52 PM   #1
Senior Member
Registered: Aug 2003
Location: Houston, TX
Distribution: Arch
Posts: 1,380

Rep: Reputation: 47
how to open a port in the firewall redhat

i ask a lot of stupid questions but here's another how would i open a port in my firewall for redhat 9.0?
Old 12-01-2003, 09:33 PM   #2
Registered: Sep 2003
Location: Adelaide, Australia
Distribution: Fedora/RH
Posts: 231

Rep: Reputation: 30
do some research into IPTABLES

this is generally the best way.. give us more information about what you are trying to do... eg open ports from external to internet OR other way around
Old 12-01-2003, 10:15 PM   #3
LQ Guru
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
There are many ways to do this but here is one way of opening up some commonly used ports that may give you an idea of how it works.


#create a table for tcp packets
$IPTABLES -N tcp_packets

# Input rules, send incoming traffic to the tcp_packets table
$IPTABLES -A INPUT -p TCP -i $INET_IFACE -j tcp_packets

# setup rules for table tcp_packets
$IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 22 -j ACCEPT
$IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 25 -j ACCEPT
$IPTABLES -A tcp_packets -p TCP -s 0/0 --dport 80 -j ACCEPT
$IPTABLES -A tcp_packets -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A tcp_packets -p TCP -s 0/0 -j DROP


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
Open port in Cisco PIX firewall aisalen Linux - General 8 12-15-2005 07:51 PM
Open LAN port through FIREWALL pbhat Fedora 2 08-12-2004 01:12 PM
Open LAN / gaim port through FIREWALL pbhat Fedora 1 08-12-2004 07:56 AM
How to open port 25 in firewall greenranger Linux - Networking 13 03-19-2003 09:04 AM
firewall.rc.config says :"open port 8080" but nmap says port is closed saavik Linux - Security 2 02-14-2002 01:16 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:32 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration