LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-20-2024, 07:03 PM   #1
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,501
Blog Entries: 2

Rep: Reputation: 68
Question help with firewalld - I don't understand what I am doing wrong


Hi,

I am trying to replace a source IP (192.168.1.40) in the zone "trusted" by another IP (192.168.15.105), but the previous IP refuses to be removed and the new IP didn't show up , but the command says it already in...What I am doing wrong ?
Code:
mastodon:~ # firewall-cmd --get-zones
block dmz docker drop external home internal libvirt libvirt-routed nm-shared public trusted work
mastodon:~ # firewall-cmd --list-sources --zone=trusted
192.168.1.40
mastodon:~ # firewall-cmd --zone=trusted --remove-source=192.168.1.40 --permanent
success
mastodon:~ # firewall-cmd --list-sources --zone=trusted
192.168.1.40
mastodon:~ # firewall-cmd --zone=trusted --add-source=192.168.15.105 --permanent
success
mastodon:~ # firewall-cmd --list-sources --zone=trusted
192.168.1.40
mastodon:~ # firewall-cmd --zone=trusted --add-source=192.168.15.105 --permanent
Warning: ALREADY_ENABLED: 192.168.15.105
success
mastodon:~ # firewall-cmd --list-sources --zone=trusted
192.168.1.40
mastodon:~ #
PS: Never mind, I realized that `--permanent` only change the settings for the next reload of rules, not the current one. And that the `--list-sources` display the current set of rules that `--permanent` didnīt modified ! Ouch !
TLDR; run the add/remove commands, then `systemctl reload firewalld` and after that the listing will be updated.

Last edited by marozsas; 02-20-2024 at 07:28 PM.
 
Old 02-20-2024, 07:32 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,834

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
That is because you're applying changes to the permanent configuration, and reading from the runtime configuration.

Check
Code:
firewall-cmd --list-sources --zone=trusted --permanent
and reload firewall with
Code:
firewall-cmd --reload
then check runtime config again
Code:
firewall-cmd --list-sources --zone=trusted

Last edited by ferrari; 02-20-2024 at 07:36 PM.
 
Old 02-20-2024, 07:46 PM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,834

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
For your future reference:
https://docs.fedoraproject.org/en-US...anent_settings
 
  


Reply

Tags
firewalld



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] I don't understand why this port rule in firewalld mtdew3q Linux - Security 3 05-22-2022 06:26 PM
[SOLVED] If you don't understand a cmd don't do it! GPGAgent Linux - Newbie 21 12-30-2020 03:05 PM
[SOLVED] Not understand command what is doing priyankabade Linux - Newbie 3 05-10-2012 06:22 PM
Doing something wrong with driver install, don't know what aeroegnr Linux - Newbie 10 11-24-2007 11:42 PM
2domain but backingup the wrong one .. what am i doing wrong salimmeethoo Linux - Server 3 10-17-2007 10:43 AM

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

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