LinuxQuestions.org
Review your favorite Linux distribution.
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 11-18-2002, 05:01 PM   #1
chris
Member
 
Registered: Nov 2001
Location: Toronto, Canada
Distribution: CentOS 4
Posts: 66

Rep: Reputation: 15
enabling ports!


I've asked this before and I'll ask again as I can't seem to get any answers anywhere. I'm using RH 8 and by default it blocked all ports except for port ssh /22 and I want to enable port 80 for apache... how do I do that please??

thanks in advanced!

Chris
 
Old 11-18-2002, 06:35 PM   #2
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Rep: Reputation: 30
you could try

/sbin/modprobe ip_conntrack
/sbin/modprobe ip_tables
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_mangle
/sbin/modprobe iptable_nat
/sbin/modprobe ipt_LOG
/sbin/modprobe ipt_limit
/sbin/modprobe ipt_MASQUERADE

/sbin/iptables -A INPUT -p tcp --syn -s 0/0 --dport 80 -j ACCEPT
/sbin/iptables -A INPUT -p TCP -m state --state ESTABLISHED,RELATED -s 0/0 --dport 80 -j ACCEPT
/sbin/iptables -A INPUT -p TCP -j DROP

but be careful you're playing with you're firewall

or try lokkit under extra>system tools
 
Old 11-18-2002, 09:10 PM   #3
chris
Member
 
Registered: Nov 2001
Location: Toronto, Canada
Distribution: CentOS 4
Posts: 66

Original Poster
Rep: Reputation: 15
Thanks alot for your response.. I'm definately gonna try that and as far as lokkit, I got rid of it since I could never change any changes I made to it. I'd rather insert a few rules as you've shown me.

thanks again!

Chris
 
Old 11-19-2002, 08:06 AM   #4
chris
Member
 
Registered: Nov 2001
Location: Toronto, Canada
Distribution: CentOS 4
Posts: 66

Original Poster
Rep: Reputation: 15
Just so you know that I tried the rule set you gave me and the last satement "/sbin/iptables -A INPUT -p TCP -j DROP" ended up blocking all ports. After commenting that line, still the same problem, port 80 still wasn't opened. Thanks for your help anyways and I guess I'll just have to try to learn IPtable rules on my own.

cheers!

Chris
 
Old 11-19-2002, 10:51 AM   #5
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Rep: Reputation: 30
if you don't matter about security you could try also

/sbin/iptables -P OUTPUT -j ACCEPT

/sbin/iptables -P INPUT -j ACCEPT
you change the policy set not secure



good tutorial
http://www.netfilter.org/documentati...-tutorial.html


good luck
 
Old 11-19-2002, 02:32 PM   #6
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Rep: Reputation: 30
i looked it again try

first /sbin/iptables -F

/sbin/modprobe ip_conntrack
/sbin/modprobe ip_tables
/sbin/modprobe iptable_filter
/sbin/modprobe iptable_mangle
/sbin/modprobe iptable_nat
/sbin/modprobe ipt_LOG
/sbin/modprobe ipt_limit
/sbin/modprobe ipt_MASQUERADE

/sbin/iptables -A INPUT -p tcp --syn -s 0/0 --dport 80 -j ACCEPT
/sbin/iptables -A INPUT -p TCP -m state --state ESTABLISHED,RELATED -s 0/0 --dport 80 -j ACCEPT
/sbin/iptables -A INPUT -p TCP -j DROP
/sbin/iptables -A OUTPUT -p ALL-o(your ip from isp) -j ACCEPT

GOOD LUCK
 
Old 11-19-2002, 05:19 PM   #7
chris
Member
 
Registered: Nov 2001
Location: Toronto, Canada
Distribution: CentOS 4
Posts: 66

Original Poster
Rep: Reputation: 15
THANKS ALOT!!! that worked! I appreciate the time you took to help me out on this!

Chris
 
Old 11-19-2002, 05:49 PM   #8
jetfreggel
Member
 
Registered: May 2002
Posts: 172

Rep: Reputation: 30
and i am glade i made it work (as test,iptables newbie---> me)

you're welcome
 
  


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
Cannot Open Mail Server Ports 25, 110, and 220. Other Ports will open. Binxter Linux - Newbie 9 11-29-2007 02:03 AM
enabling ports for certain apps cjae SUSE / openSUSE 1 11-28-2005 12:20 AM
enabling ports on iptables deley71 Red Hat 1 07-14-2004 02:54 PM
Enabling ports for samba toadoy Linux - Newbie 3 07-08-2004 06:35 AM
Enabling telnet on other ports guinnyn Linux - Networking 0 08-22-2003 07:49 PM

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

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