CentOS 7 Router/DHCP Server: Second NIC adapter plugged in but not sending internet through the cable
Solution 1:
You need to enable IP Forwarding in the kernel and net the firewall do NAT in the router. Just because you have two NICs, you machine does not "automagically" become a router
Let the kernel handle IP traffic:
vi /etc/sysctl_d/ip_forward.conf
and add the following line:
net.ipv4.ip_forward = 1
activate the change:
sysctl -p /etc/sysctl.d/ip_forward.conf
Next step is most likely to configure the firewall to allow IP masquerading between the public and private interfaces. Here ens224
is the public interface and 10.73.0.0/24
is the private network.
firewall-cmd --permanent --direct --passthrough ipv4 -t nat -I POSTROUTING -o ens224 -j MASQUERADE -s 10.73.0.0/24
Don't forget to assign the interface to the external firewall zone:
firewall-cmd --change-interface=ens224 --zone=external --permanent
The Default zone should (most likely) be internal:
firewall-cmd --set-default-zone=internal
Reload firewall's config
firewall-cmd --complete-reload
Restart all networking and firewall services:
systemctl restart network && systemctl restart firewalld
Verify the firewall settings:
firewall-cmd --list-all
firewall-cmd --list-all --zone=external
Set the internal's interface IP as the default gateway on your clients.