I'm using RHEL 8 and am trying to set-up NAT/MASQUERADE using firewall-cmd. So far I have all the network interfaces and services in the public zone. eno8303 is the internal nic and eno8403 is the external nic. This is my procedure but I can't get it to work:-
sudo firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -o eno8303 -j MASQUERADE sudo firewall-cmd --permanent --direct --passthrough ipv4 -A FORWARD -i eno8403 -m state --state ESTABLISHED,RELATED -j ACCEPT
edit /etc/sysctl.conf to include the setting
net.ipv4.ip_forward = 1
And then sysctl -p /etc/sysctl.conf
Expected to be able to use the server as an internal gateway but nothing happens.