LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2020, 05:41 PM   #1
RadicalDreamer
Senior Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 1,820

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
I want to add/convert an iptables rule to Firewalld


Here is the iptables rule I wish to add to Firewalld:
Code:
iptables -A OUTPUT -o eth0 -m owner --gid-owner 1001 -j DROP
I'm helping someone get openSUSE Leap 15.2 working and I want to keep one of their groups from accessing the internet through a specific interface.
 
Old 11-14-2020, 07:18 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,840

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
It is firewalld direct rules that you need to investigate...
https://firewalld.org/documentation/...ld.direct.html

Based on the rule you supplied, something like the following...
Code:
firewall-cmd --permanent --direct --add-rule ipv4 filter OUTPUT 0 -o eth0 -m owner --gid-owner 1001 -j DROP
The direct rule is added to /etc/firewalld/direct.xml, and will take effect when firewalld is next restarted
Code:
systemctl restart firewalld
Some examples to hep give you more of an idea about this...
https://serverfault.com/questions/70...h-firewall-cmd
https://access.redhat.com/discussions/3238521
 
1 members found this post helpful.
Old 11-14-2020, 07:20 PM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,840

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
PS: You can make a similar rule for IPv6 if required.
 
1 members found this post helpful.
Old 11-14-2020, 11:17 PM   #4
RadicalDreamer
Senior Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 1,820

Original Poster
Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Thank you ferrai, that rule you gave me worked!
 
Old 11-15-2020, 12:17 AM   #5
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,840

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Glad to have been of guidance. The rule wasn't mine - it was the rule you posted, but applied as a firewalld direct rule (and as per the documentation I linked to).
 
1 members found this post helpful.
  


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
Socket server security firewalld rich rule vs logwatch newbie14 Linux - Security 6 10-02-2020 10:53 AM
[SOLVED] firewalld - cannot state a rule with port range Sum1 Linux - Software 1 04-11-2018 03:04 PM
iptables: rule with RETURN target just after a rule with ACCEPT target Nerox Linux - Networking 6 09-04-2011 03:33 PM
iptables: why do I want INPUT rule 3 (built by firestarter) linuxStudent11 Linux - Security 4 09-21-2010 09:28 PM
iptables(marking) + ip rule add fwmark 1 table 200 + ip route add via GW table 200 ?? amitsharma_26 Linux - Networking 9 05-26-2010 06:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:46 AM.

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