LinuxQuestions.org
Help answer threads with 0 replies.
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-31-2014, 10:40 AM   #1
ciumcix
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Rep: Reputation: Disabled
iptables incoherente


Good morning everyone
Im newbie in iptables, but in my new job I have to admin firewall with iptables.
I was studing the configurations but I notice that is no coherent.
Do you know why is bloquing port 15000?, What services is used the port 15000.
I have notice too that rules are repeated...please send me your suggestions to correct this configurations.

PD: Sorry my English level :S


-A INPUT -s x.x.x.x/32 -p tcp -m tcp --dport 15000 -j ACCEPT
-A INPUT -s x.x.x.x/32 -p udp -m udp --dport 15000 -j ACCEPT
-A INPUT -s x.x.x.x/32 -p udp -m udp --dport 15000 -j DROP
-A INPUT -s x.x.x.x/32 -p tcp -m tcp --dport 15000 -j DROP
-A INPUT -p tcp -m tcp --dport 15000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 15000 -j DROP
-A INPUT -s 0.0.0.0/32 -p tcp -m tcp --dport 15000 -j ACCEPT
-A INPUT -s 0.0.0.0/32 -p tcp -m tcp --dport 15000 -j DROP
-A INPUT -p tcp -m tcp --dport 23 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 15000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 15000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 20000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 20000 -j DROP
-A INPUT -p tcp -m tcp --dport 15000 -j DROP
-A INPUT -p tcp -m tcp --dport 23 -j DROP
-A INPUT -p tcp -m tcp --dport 15000 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 23 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 15000 -j ACCEPT

x.x.x.x is a IP public
 
Old 12-31-2014, 11:33 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by ciumcix View Post
(..) in my new job I have to admin firewall with iptables.
I'm sorry to hear that ;-p


Quote:
Originally Posted by ciumcix View Post
Do you know why is bloquing port 15000?, What services is used the port 15000.
Usually querying for IANA designated port numbers ('getent services [some_port_number]') will work. In this case it returns "hydap 15000/tcp" (whatever hydap is). You should also look at the system (and maybe adjacent machines?) with 'netstat -anlpe' which gives you listening ports. Maybe that reveals what's listening on TCP/15000. Next there may be a sysadmin log denoting any changes but you'd have to ask your colleagues (if any ;-p) for that.


Quote:
Originally Posted by ciumcix View Post
I have notice too that rules are repeated...please send me your suggestions to correct this configurations.
Please run 'iptables-save' to provide the complete rule set currently in use, then obfuscate any IP addresses and post it between BB code tags: [code]Text here.[/code]
 
Old 12-31-2014, 04:54 PM   #3
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
Quote:
Originally Posted by ciumcix View Post
I was studing the configurations but I notice that is no coherent.
That probably wasn't as clear as you had hoped; there are things there that do not seem to make sense, but it is always clearer to look at the actual iptables ruleset rather than the commands that create the rules. So, if you follow unSpawn's suggestion, that should help.

Quote:
Originally Posted by ciumcix View Post
Do you know why is bloquing port 15000?, What services is used the port 15000.

Well, I don't why it is blocking 150000, or even if it is blocking 15000. That should be clearer later. However, at little more detail on 15000 (from here or by parsing /etc/services):


hydap 15000/tcp # Hypack Data Aquisition
hydap 15000/udp # Hypack Data Aquisition

and, this being exactly what the internet was invented for:

http://odomhydrographic.com/product/hypack/

HYPACK, Inc. develops PC-based software that brings together surveying, positioning and navigation into one flexible and user friendly program. Hypack provides the user with all of the tools necessary to plan a mission, collect data and post process.

If you feel convinced that your organisation has nothing to do with hydrographic data acquisition of this hypack program, what has almost certainly happened is that someone has thought 'I need one or more ports for this program/system that we are developing, what is a port number that we will never use for its assigned purposes?'. In that case, you will have to do some detective work, the difficulty of which might be set by your organisation's ability to document what it is doing, or your ability to find someone who acts as the corporate cultural memory bank...


Quote:
Originally Posted by ciumcix View Post
I have notice too that rules are repeated...please send me your suggestions to correct this configurations.
Suggestion 1) Don't.
Suggestion 2) Don't, until you are certain that you know what you are doing, and you know for sure that you aren't about to bring the business to its knees. And, you have though about what happens if something goes wrong. And, you can define what problem you are trying to cure. OK, I'll allow that, potentially, 'It is a mess' is a problem, and that it is a problem that you can think about curing, but not working at all can well be a worse problem than 'working, but no one quite knows why or how' (which, if pushed, you'd have to describe as 'unmaintainable').

Presumably, this ruleset came about because someone created it; is that person still available to answer questions?


Just looking at a couple of the rules:

Quote:
Originally Posted by ciumcix View Post

-A INPUT -s x.x.x.x/32 -p tcp -m tcp --dport 15000 -j ACCEPT
-A INPUT -s x.x.x.x/32 -p tcp -m tcp --dport 15000 -j DROP

x.x.x.x is a IP public
Presumably, in every case, x.x.x.x is the same IP address.

As an exercise for the interested student (hint: that's you) and just to get you warmed up, you may want to think about what these two rules do (and, for extra points, whether the order of those rules is important). In doing this you can choose to use the materials contained in the Frozentux tutorial on iptables. Or, some other material, if you prefer.
 
  


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 error in android: iptables-save and iptables-restore not working preetb123 Linux - Mobile 5 04-11-2011 01:56 PM
On what basis CHAIN integer values are generated in IPtables under iptables file? haariseshu Linux - Server 3 11-05-2009 04:25 AM
iptables v1.2.9: Unknown arg `/sbin/iptables' Try `iptables -h' or 'iptables --help' Niceman2005 Linux - Security 4 12-29-2005 08:20 PM
Iptables - Couldn't load target `ACCPET':/lib/iptables/libipt_ACCPET.so: z00t Linux - Security 3 01-26-2004 02:24 AM
My iptables script is /etc/sysconfig/iptables. How do i make this baby execute on boo ForumKid Linux - General 3 01-22-2002 07:36 AM

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

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