LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-09-2015, 10:14 PM   #1
cebo_myeza
LQ Newbie
 
Registered: Apr 2015
Posts: 3

Rep: Reputation: Disabled
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
 
Old 06-10-2015, 05:00 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You need to add that as a rule to the /etc/sysconfig/iptables file by editing it.
It's not a cmd...
 
Old 06-10-2015, 05:27 AM   #3
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,805

Rep: Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140Reputation: 1140
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with Port Open UDP colonel-top Linux - Newbie 1 02-02-2014 11:00 AM
iptables port 161 UDP/TCP aocferreira Linux - Networking 7 03-18-2011 04:08 PM
UDP Port 161 kopper27 Linux - Newbie 8 06-09-2010 02:57 PM
How to open a UDP port thiagarn Linux - Newbie 20 05-29-2008 09:00 AM
How do I open up a UDP port? Dirt Linux - Networking 9 06-06-2003 05:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration