Centos Gateway
Posted: 22 Dec 2016, 09:42
We're trying to build a Centos Gateway for our cloud host server. This is actually easier than I first thought with iptables using the following command to set-up NAT masquerading:
/sbin/iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
Having already set-up IP Forwarding, this command pretty much allows the guests to use the Centos Gateway to connect to the Internet and works well.
We would like to use CSF instead of iptables since we are not iptables "experts" and prefer the CSF GUI.. Apparently from what I've read, we should use csfpre.sh and/or csfpost.sh to achieve this. Using the full path /sbin/iptables.... in csfpre.sh or csfpost.sh we can run the above command with CSF and MASQUERADE appears in the POSTROUTING section the same as with iptables.
However, the NAT gateway no longer works with CSF. Does anybody know how to correct this issue?
Is there a better way to do this with CSF?
/sbin/iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
Having already set-up IP Forwarding, this command pretty much allows the guests to use the Centos Gateway to connect to the Internet and works well.
We would like to use CSF instead of iptables since we are not iptables "experts" and prefer the CSF GUI.. Apparently from what I've read, we should use csfpre.sh and/or csfpost.sh to achieve this. Using the full path /sbin/iptables.... in csfpre.sh or csfpost.sh we can run the above command with CSF and MASQUERADE appears in the POSTROUTING section the same as with iptables.
However, the NAT gateway no longer works with CSF. Does anybody know how to correct this issue?
Is there a better way to do this with CSF?