LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-10-2015, 02:11 AM   #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, 03:47 AM   #2
roger_heslop
Member
 
Registered: Oct 2009
Location: Leander, TX
Distribution: Fedora 20
Posts: 97

Rep: Reputation: 35
The rule that you've used looks like what you might see as a rule in /etc/sysconfig/iptables, but it's not a command. To apply that same rule, use the same syntax but starting with 'iptables'. For example:

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
That will change the running state of the firewall, but it's lost once restarted unless you save the configuration.

Code:
service iptables save
 
Old 06-11-2015, 11:11 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by cebo_myeza View Post
Code:
-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
Roger beat me to it
Go Roger, go!
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

Tags
centos, centos6, linux command, network monitoring



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
how to open UDP 161 port to allow only the SNMP monitoring server cebo_myeza Linux - Newbie 2 06-10-2015 05:27 AM
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 do I open up a UDP port? Dirt Linux - Networking 9 06-06-2003 05:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:37 PM.

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