netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitri Seletski <drjoms@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: feature request, way to check specific IP/port/protocol/etc
Date: Wed, 16 Oct 2019 21:50:33 +0100	[thread overview]
Message-ID: <74c57209-2f6e-5cc9-d64b-e2e0eddcae6e@gmail.com> (raw)

Hello Dear IPTABLES/Netfilter Devs.


Thank you very much for your efforts.

I am strong  believer, that if you don't do something yourself - it wont 
be done.
With that said, I am no coder.(No C coder and not a competent by any 
stretch of imagination)


I have come across a situation where I need to write a script. In this 
script would be nice to check if specific port is opened. I checked 
iptables --help and I can't seem to find an easy way to check it.

I can do something like iptables -Ln and get a range and try to work 
around that. But I think it would be better to implement couple of ideas 
below:


1. To make a new option. Similar to -L , that will verbosely show all 
subnets/port ranges. So user can grep anything that may be remotely 
relevant. And yes I understand it may take a lot of time in some cases, 
but sometimes CPU time is a commodity you do have.

2. To make new option. May be call it -S, that will search, based on 
parameters, any and all rules that match for e.g. specific port or IP or 
protocol or combination of those.

So for example, -S -p tcp -s 127.0.0.1 -d 192.168.0.1

should show any rules that match search criteria above  and default 
policy. In other words likely to affect tcp ip coomunication between 
127.0.0.1 and 192.168.0.1

Which will give indication to script writers, if communication between 
script or some other app is possible to outside of the machine or to 
other VM or some other such stuff.

It's my first suggestion to a big list like this. So hit me on the face 
with soldier boots, but gently please. English is not my native tongue, 
so if you need clarification of stuff I have written above -  I'd be 
very happy to try to insult your intelligence with my attempts at 
english again.


Kind Regards

Dmitri


                 reply	other threads:[~2019-10-16 20:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=74c57209-2f6e-5cc9-d64b-e2e0eddcae6e@gmail.com \
    --to=drjoms@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).