LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-08-2020, 05:14 AM   #1
slackbat
Member
 
Registered: Dec 2005
Location: Mid-West-Wales
Distribution: Slackware 14.2_64_multilib - Salix 14.2 - devuan
Posts: 140

Rep: Reputation: 27
iptables rules for p2p gtk-gnutella


Hi all,

I am looking for an iptables rules - input/output tcp/udp - for gtk-gnutella.

No matter what I have tried it has not worked, and looking arong on the web has not come up with a solution.

Code:
# Following 2 rules 4 Gtk-Gnutella
$IPT -A INPUT -m state --state NEW,ESTABLISHED -p tcp --dport 40411 -j ACCEPT
$IPT -A INPUT -m state --state NEW,ESTABLISHED -p udp --dport 40411 -j ACCEPT
$IPT -A OUTPUT -m state --state ESTABLISHED -p tcp --dport 40411 -j ACCEPT
$IPT -A OUTPUT -m state --state ESTABLISHED -p udp --dport 40411 -j ACCEPT
Cant get this right - oh I'm using slackware - if that makes a difference.

TIA
 
Old 04-23-2020, 07:56 AM   #2
jem777
LQ Newbie
 
Registered: Apr 2020
Distribution: Ubuntu, Debian, Devuan, Raspbian, Armbian, Parrot OS
Posts: 11

Rep: Reputation: Disabled
I'm not really familiar with gtk-gnutella, but with the above rules, your client will be able to receive connections, but not able to initiate connections of its own.

Also, please remember that iptables rules by default are for your *system*, not a particular piece of software you run.
A neat trick to apply rules to a particular piece of software only (though this can be done in more than one way), is to run that software under a particular user, and use iptables owner module:

iptables -A OUPUT -m owner --uid-owner <numeric id of the process owner> -j ACCEPT

A good way to debug is changing the rule that drops traffic to a log and drop. The below is from my firewall:

iptables -N LnD
iptables -A LnD -p tcp -m limit --limit 1/s -j LOG \
--log-prefix "[TCP DROP] " --log-level debug
iptables -A LnD -p udp -m limit --limit 1/s -j LOG \
--log-prefix "[UDP DROP] " --log-level debug
iptables -A LnD -p icmp -m limit --limit 1/s -j LOG \
--log-prefix "[ICMP DROP] " --log-level debug
iptables -A LnD -f -m limit --limit 1/s -j LOG \
--log-prefix "[FRAG DROP] " --log-level debug
iptables -A LnD -j DROP

And then just change the target of your rule(s) that drop traffic to -j LnD instead of -j DROP. That way, you can observe what gets dropped in your logfiles.

You can do something similar for accepted connections, though it has to be used cautiously on a system that has many accepted connections.

HTH.

Last edited by jem777; 04-23-2020 at 01:17 PM.
 
Old 04-24-2020, 02:53 AM   #3
slackbat
Member
 
Registered: Dec 2005
Location: Mid-West-Wales
Distribution: Slackware 14.2_64_multilib - Salix 14.2 - devuan
Posts: 140

Original Poster
Rep: Reputation: 27
Hi jem777

Thanks for the reply and the valuable info. I will get to it, and report back (cant do it straight away).

Cheers
 
  


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
[SOLVED] /etc/udev/rules.d/40-libsane.rules and /etc/udev/rules.d/S99-2000S1.rules missing LABEL=libsane_rules_end mumahendras3 Slackware 6 03-09-2020 02:27 AM
Wimewire Gnutella client works, but apollon-gnutella does not :( qwijibow Linux - Networking 3 03-14-2007 02:45 PM
iptables-p2p - Instalation problems | How to block p2p with iptables Woping Linux - Networking 0 03-14-2006 12:56 PM
gtk+ and gtk-gnutella Pougan Linux - Software 1 11-09-2003 08:33 PM
can't configure GTK!-gtk-gnutella ogkyusa Linux - Software 2 08-09-2003 04:38 PM

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

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