Originally Posted by Dmjmusser
Iptables is preventing me from using a monitoring service called Nagios to monitor local services (processes, disk space) on a remote host. The reason is that the Iptables on this remote host are set to only allow traffic through on port 25, and I need to dedicate another port to allow this traffic through (specifically, I'd like to use 5666). Additionally, I'd like for this remote host to only allow traffic on that port from machines on the company LAN. I'm just not sure how to go about doing this; I don't even know what commands I would use to get this started. Any help would be so greatly appreciated.
Do you use a gui or script to run iptables? What protocol does your monitoring service use?
I am assuming you use tcp. If you are using a script you can add something like this in your script.
/usr/sbin/iptables -A INPUT -i eth0 -p tcp -s 192.168.1.0/24
--dport 5666 -j ACCEPT
/usr/sbin/iptables -A OUTPUT -o eth0 -p tcp --sport 5666
-d 192.168.1.0/24 -j ACCEPT
obviously, you have replace eth0 with whatever is your interface. Also you would have to replace the network address to fit what you have.