Article 4QA6Z firewalld change via XML file

firewalld change via XML file

by
dc.901
from LinuxQuestions.org on (#4QA6Z)
Hello!
I have CentOS 7.6
Machine has two NICs; one NIC is assigned in public zone and second in trusted zone.
What I am trying to do is:
Code:# firewall-cmd --permanent --zone=trusted --add-source=192.168.1.10This works.

However, I am trying to figure out how to do this by XML file; zone config XML files are under: /etc/firewalld/zones, and there is trusted.xml

Code:<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Trusted</short>
<description>All network connections are accepted.</description>
<interface name="ens224"/>
<sources ip="192.168.1.10"/>
</zone>With above in XML, I restarted firewalld service. However, output shows:

Code:# firewall-cmd --zone=trusted --list-all
trusted (active)
target: ACCEPT
icmp-block-inversion: no
interfaces: ens224
sources:
services:
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:Trying to figure out what I am missing?latest?d=yIl2AUoC8zA latest?i=J5s7Zw_w3BM:pvMmoFKIvO0:F7zBnMy latest?i=J5s7Zw_w3BM:pvMmoFKIvO0:V_sGLiP latest?d=qj6IDK7rITs latest?i=J5s7Zw_w3BM:pvMmoFKIvO0:gIN9vFwJ5s7Zw_w3BM
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments