[CentOS] iptables

Tue Sep 15 13:41:56 UTC 2009
Filipe Brandenburger <filbranden at gmail.com>

Hi,

On Tue, Sep 15, 2009 at 07:43, CentOS List <centoslist at gmail.com> wrote:
> How do add a redirect port 26 to 25. I had googled the net and notice that
> the syntax is different
>
> iptables -A INPUT -p tcp --dport 26 -j ACCEPT
> iptables -A PREROUTING -t nat -p tcp --dport 26 -j REDIRECT --to-port 25

I suggest you use "iptables" commands to add and delete rules until
you set the firewall the way you want, and when everything is ready
use the "service iptables save" command, that will write a new
/etc/sysconfig/iptables with the current rules you have. That way you
don't risk having a syntax error or typo prevent your rules from
loading during the next reboot. If you want to preview the new file
you can run "iptables-save" that will dump the rules to the console
where you can inspect them. I also suggest that you make regular
backups of /etc/sysconfig/iptables and that you do a backup just
before running "service iptables save" just in case something goes
wrong...

HTH,
Filipe