LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 03: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, 04: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, 12:11 PM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,345
Blog Entries: 36

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 06:27 AM
Need Help with Port Open UDP colonel-top Linux - Newbie 1 02-02-2014 12:00 PM
iptables port 161 UDP/TCP aocferreira Linux - Networking 7 03-18-2011 05:08 PM
UDP Port 161 kopper27 Linux - Newbie 8 06-09-2010 03:57 PM
How do I open up a UDP port? Dirt Linux - Networking 9 06-06-2003 06:50 PM

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

All times are GMT -5. The time now is 06:10 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration