Hello,
I have a linux box which I use as a router for other PC on different VLAN. I needed to add in firewalld 0.9.3 the following direct rules:
ipv="ipv4" table="nat" chain="POSTROUTING" priotity="0" -o ppp0 - j MASQUERADE
passthrough ipv="ipv4" -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
In firewalld I have 2 zones: external with interface ppp0 and home with all other interfaces (eno1, vlan1, vlan2, vlan3 and vlan4).
Last snapshot 20210817 installed firewalld 1.0.0 and after reboot I loss internet connection for all PC on the different VLAN but internet still work for my linux box.
I see in the firewalld change description that “* NAT rules moved to inet family (reduced rule set)” and “* Direct interface is deprecated”.
on https://firewalld.org/blog/ they describe the configurations for tcp_mss_clamp using new policies
# firewall-cmd --permanent --new-policy pppTcpClamp
# firewall-cmd --permanent --policy pppTcpClamp --add-ingress-zone internal
# firewall-cmd --permanent --policy pppTcpClamp --add-egress-zone external
# firewall-cmd --permanent --policy pppTcpClamp --add-rich-rule='rule tcp-mss-clamp'
but nothing about nat and masquerade.
I applied the firewall_cmd commande about policies for tcp_mss_clamp but when executing the reload I have a very long error message and the systemctl status is
# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2021-08-20 23:04:07 CEST; 2s ago
Docs: man:firewalld(1)
Main PID: 29057 (firewalld)
Tasks: 2 (limit: 4915)
CPU: 1.363s
CGroup: /system.slice/firewalld.service
└─29057 /usr/bin/python3 /usr/sbin/firewalld --nofork --nopid
Aug 20 23:04:07 hpprol2 systemd[1]: Starting firewalld - dynamic firewall daemon...
Aug 20 23:04:07 hpprol2 systemd[1]: Started firewalld - dynamic firewall daemon.
Aug 20 23:04:08 hpprol2 firewalld[29057]: ERROR: 'python-nftables' failed: internal:0:0-0: Error: Could not parse integer
JSON blob:
{"nftables": {"metainfo": {"json_schema_version": 1}}, {"add": {"chain": {"family": "inet", "table": "firewalld", "name": "mangle_PRE>
Aug 20 23:04:08 hpprol2 firewalld[29057]: ERROR: COMMAND_FAILED: 'python-nftables' failed: internal:0:0-0: Error: Could not parse integer
JSON blob:
{"nftables": {"metainfo": {"json_schema_version": 1}}, {"add": {"chain": {"family": "inet", "table": "firewalld", "name": "mangle_PRE>
The lines under json blob are very big (more than 78KB)
In /etc/firewalld/policies I found file pppTcpClamp.xml files
<policy target="CONTINUE">
<rule>
<tcp-mss-clamp value="None"/>
</rule>
<ingress-zone name="home"/>
<egress-zone name="external"/>
</policy>
I removed the xml file and firewalld restart without error: Strange that firewalld blog is giving a bad command>:(
How can I solve the parse error?
In the man of firewall-cmd I see this remark: “The direct interface has been deprecated. It will be removed in a future release. It is superseded by policies, see firewalld.policies(5).” but there is no description of nat/MASQUERADE in firewalld.policies.
I tried adding a rich rule for ipv4 and element “masquerade” in zone “external”: this rule is accepted but does not solve the internet connection for the PC/vlan
So how can I add the nat/MASQUERADE rule in firewalld for ppp0?
Below the description of my network
┌────────────────────────┐ ┌───────┐
│ Tumbleweed Server with │ eno3 (no IP) │ CABLE │
│ DHCP + DNS + firewalld ├───────────ppp0───────│ Modem ├─── Internet
│ │ │ │
│ do intervlan routing │ └───────┘
└───┬────────────────┬───┘
eno2 (No IP) eno1 (192.168.1.120)
│ │enslaved in br0 (for VM)
│ │
trunk│ port VLAN 1
┌───┴────────────────┴──────────────────────────────────┐
│ TL─SG3216 Swithch Level 2 │
│ │
│ VLAN ID │
│ 4 2 3 │
│(192.168.4.0/24) (192.168.2.0/24) (192.168.3.0/24) │
└───┬──────────────────┬──────────────────┬─────────────┘
│ │ │
│ │ │
Samba PCs PCs
192.168.4.91 192.168.2.100─ 192.168.3.100─
raspberry 192.168.2.199 192.168.3.199
Printer 192.168.4.50
Many thanks in advance
Philippe