LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to open UDP 161 port to allow only the SNMP monitoring server (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-open-udp-161-port-to-allow-only-the-snmp-monitoring-server-4175544957/)

cebo_myeza 06-09-2015 10:14 PM

how to open UDP 161 port to allow only the SNMP monitoring server
 
hi

i am working on a splunk project and i am using centos as my operating system, i just need help on how to allow only the SNMP monitoring server (SPLUNK) to connect to UDP 161 port in centos using CLI.And my monitoring host is 192.168.1.2/24

i have been using CLI command below but i am getting an error of bash: -A: command not found

-A INPUT -s 192.168.1.2/24 -p udp -m udp --sport 1024:65535 --dport 161 -m state --state NEW,ESTABLISHED -j ACCEPT

please help

chrism01 06-10-2015 05:00 AM

You need to add that as a rule to the /etc/sysconfig/iptables file by editing it.
It's not a cmd...

ferrari 06-10-2015 05:27 AM

If you want to add the rule on the fly (eg for testing purposes), you could do
Code:

iptables -A INPUT -s 192.168.1.2/24 -p udp -m udp --sport 1024:65535 --dport 161 -m state --state NEW,ESTABLISHED -j ACCEPT


All times are GMT -5. The time now is 04:09 PM.