Thursday, 12 September 2013

How do I open/close ports in iptables based on a network service status?

How do I open/close ports in iptables based on a network service status?

I would like to have iptables dynamically open ports as a network service
is enabled and close ports as they are disabled.
Is there an established way to do this? Should I be mucking around with
iptables, /etc/init.d/* files, or clobber together my own ./script?
I don't think it provides much in added security, but it would be useful
for deployments where a full iptables configuration can be copied over for
many services, exposing ports only as those services are configured and
activated.
I am specifically using CentOS 6.2 on a Linode VPS, but I would also like
to be able to use this on an Ubuntu Server VM (12.04 LTS) or another other
Debian variant.

No comments:

Post a Comment