3

I have an Fedora 26 server I use as a gateway/router (Along with other things) 2 NIC's and a static external IP

I am used to iptables and I use SNAT vs MASQ

I have done a good bit of searching for how to use SNAT with firewalld - but cannot find anything.

W8WCA
  • 59
  • 1
  • 5

1 Answers1

3

You have to use direct options:

[--permanent] --direct --add-rule { ipv4 | ipv6 | eb } table chain priority args

Add a rule with the arguments args to chain chain in table table with priority priority.

firewall-cmd --permanent --direct --add-rule NAT POSTROUTING  0 -o eth0 -j SNAT --to 1.2.3.4

or

--direct --passthrough { ipv4 | ipv6 | eb } args

Pass a command through to the firewall. args can be all iptables, ip6tables and ebtables command line arguments. This command is untracked, which means that firewalld is not able to provide information about this command later on, also not a listing of the untracked passthoughs.

firewall-cmd --permanent --direct --passthrough -t nat -A POSTROUTING -o eth0 -j SNAT --to 1.2.3.4
mrc02_kr
  • 1,973
  • 17
  • 31