LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-22-2004, 07:45 PM   #1
caps_phisto
Member
 
Registered: Sep 2004
Location: NH
Distribution: FC6, FC1-4, RH9, Gentoo 2006.0/1, Slackware 10.1/2,11, Vector SOHO 5.0.1
Posts: 237

Rep: Reputation: 30
IPtables question


If I have the following lines in my IPtables file (/etc/sysconfig/iptables)
Code:
 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1:24 -j DENY
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 26:79 -j DENY
Does that imply that I wish to have port 25 open? Or should I input the following line as well?
Code:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
I am only asking because due to the holidays I cannot get to a machine that can ssh in and test this out. (Also the above lines are only and example, not a real config. I too noticed that 22 would be closed if I really used the above config).

Thanks in advance.
 
Old 12-22-2004, 08:52 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
It would depend on the default target of your RH-Firewall-1-INPUT chain (-P policy...). If the default target is DROP, then you need to explicitly allow connections to port 25. btw if you just want to allow all mail to 25 you can ditch the "-m state --state NEW -m tcp".

-m tcp isn't a valid rule anyway....
 
Old 12-24-2004, 12:47 AM   #3
predator.hawk
Member
 
Registered: Aug 2004
Location: USA
Distribution: FreeBSD-5.4-STABLE
Posts: 252

Rep: Reputation: 30
those lines (the first two) are rejecting packets not accepting. the third line is correct aside from -m tcp.

~predatorfreak
 
Old 12-26-2004, 04:26 AM   #4
omlex
LQ Newbie
 
Registered: Jul 2003
Posts: 22

Rep: Reputation: 15
how to change http port 80 to 8080

Hi All,

I wish someone could help me with this iptables problem. I have a proxy server and it works great, however, I've noticed that video streaming is able to pass thru port 80 of my firewall (/etc/sysconfig/iptables).

Question, how can i block/disable it since Im not using any port other than 80. I'm not using squid and not running webserver in my network. I plainly used MASQUERADING. I tried the -j REDIRECT but it failed coz i dont have a webserver. I also tried changing httpd tcp/udp in /etc/services but it didn't work.

I plan to use port 8080 since video streaming uses 80 and not sure it will work this time. But my problem now is how can I change the default port of httpd

Any suggestions?? pleassee i ran out of ideas...below is my config

thanks

-A POSTROUTING -s 192.168.0.0/255.255.0.0 -o eth0 -j MASQUERADE

-A FORWARD -i eth1 -o eth0 -p tcp -m tcp --dport 80 -j ACCEPT
 
  


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 question iomari Linux - Security 4 01-13-2005 12:14 AM
Iptables Question? unixfreak Linux - Security 1 09-01-2004 08:23 PM
iptables Question gauge73 Linux - Networking 3 12-14-2003 12:02 AM
IPtables Question jacovds Linux - Security 10 11-17-2003 09:46 AM
iptables question Texicle Slackware 7 01-19-2003 12:48 AM

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

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