-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OIDfilter config #37
Comments
Could you post some relevant logs from server and perhaps from oidfilter plugin please? |
Here is the conf for OIDfilter i tested with to only allow to view the upstatus on one port.
My topology is PublicIP (Manager) And here's a TCPdump from the proxy
Here is a screenshot from iftop when i did the same snmpget command from the manager (twice) |
Is it correct that the forwarder (server) listens on Do you see anything in the snmpfwd-server logs when you run snmpget? |
In the client config, why is the client sending SNMP packets to Also note, that if your switch operates with a different community name than then manager is using, then you should configure that community name through |
Yes it listens to the public IP. Is it easier to bind it to the firewall? When i monitored the active interface on the server (forwarder) the source-address was the public IP so i thought it didn't matter. |
You should bind snmpfwd server to the interface where the original SNMP queries from your manager come to (not from!). Which is the IP of that first interface in the chain? Note that |
Looking at your topology, may be you could just:
|
I'm not running the logger plugin propperly and getting no output there but i changed my config for client.conf and server.conf server.conf
Client.conf
but with this conf when i run
my output is still
But the SNMP-message is obviously reaching the proxy. This is showing when i'm monitoring the interface. But i have no output in snmpfwd loggfile. |
Looks good except the community name you use - with
But you still see some records there on the startup, right? But nothing related to your queries? Or logging is not functional at all? |
No my /tmp/snmpfwd-brief.log is completly empty. On startup you say?
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Ilya Etingof <notifications@github.com>
Sent: Tuesday, February 19, 2019 10:26:53 PM
To: etingof/snmpfwd
Cc: Pelleplast; Author
Subject: Re: [etingof/snmpfwd] OIDfilter config (#37)
Looks good except the community name you use - with snmpget you are querying snmpfwd-server which has community public configured.
But i have no output in snmpfwd loggfile.
But you still see some records there on the startup, right? But nothing related to your queries?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#37 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AtXFFK4OW3636r8dLbrycml6vCCu_kd2ks5vPGwdgaJpZM4bCbWV>.
|
That The meat of the matter is logged by snmpfwd processes themselves. They should log to stderr by default, but you can set up file or syslog logging. It should be easy to see what's happening there as soon as SNMP packets start hitting the proxy. |
When i try to run cat /dev/stderr to see some info from log the command just keeps running withou any output
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Ilya Etingof <notifications@github.com>
Sent: Tuesday, February 19, 2019 10:40:50 PM
To: etingof/snmpfwd
Cc: Pelleplast; Author
Subject: Re: [etingof/snmpfwd] OIDfilter config (#37)
That /tmp/snmpfwd-brief.log is an audit log. It might have some details on the passing traffic.
The meat of the matter is logged by snmpfwd processes themselves. They should log to stderr by default, but you can set up file<http://snmplabs.com/snmpfwd/configuration/index.html#logging-method-file> or syslog<http://snmplabs.com/snmpfwd/configuration/index.html#logging-method-syslog> logging.
It should be easy to see what's happening there as soon as SNMP packets start hitting the proxy.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#37 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AtXFFJeu5VgwNPHeNR44TUlVlorLYRYXks5vPG9igaJpZM4bCbWV>.
|
I think you can't read from How do you run Alternatively, if you configure snmpfwd to log to a local file, you should have all logging going there. |
When i run
I get following output
Then as sudo
the command is accepted |
Ah, I see now! If you run it under root (which is required for binding ports < 1024), you need to specify the user and the group to which the process should switch upon startup. Assuming you have
May be you also need to specify your config file via |
|
That's a good progress! Are the config files you've pasted above still the same you are running? I suspect you might have a Alternatively, try |
I had the config file written like
/home/ueexjobo/.local/snmpfwd/plugins/
But i got the same output and then i tried to change it to ~. I haven't created any files while in root. All the files are created as ueexjobo user.
|
This is curious - I can't reproduce this behavior so far. Are you certain that the Are you using snmpfwd 0.4.4? |
Looking at the code, the above suggestion won't work because the code does not expand "~" at all. What's interesting that the path in this message in the log:
Comes directly from the
option. How come you have different paths in the config and in the log...? Hmm... |
The whole path to the snmpserver.py is
The path for the plugins are
|
I removed a space between
now when i run
My output is
|
No-no, you should neither remove spaces nor use "~" in the config. The right config should be:
So how did you install snmpfwd? Was it just I'd like to build the same environment and use your config files to reproduce this puzzling behavior. |
|
Which Python version? Is it on Linux? Can you share your |
Ha! Awesome! So what was the problem? Now it seems you need to have |
There were a space between Is it needed to have two windows of putty to have client running on one and server on the other?
in respons.
returns:
is this correct? I'm runnig the example config for OIDfilter.conf |
That's a good way when setting things up. Once everything is configured, you should
Looks good. The example config allows just
You can change with the config to see how it affects the behavior to make sure it filters out stuff the way you want it. |
Waow thank you sooooooo much! you've saved me like never before. I'll try to configure some OIDfiltering without destroying everything :) |
I don't really understad the peers-group config. No stress with this but would like to filter based on source address. So when i send snmpget from 80.244.65.175 i want to restrict OIDs but with same string sent from another IP i want to allow different OIDs. I tried changing the |
This is definitely doable.
This can be used if you make snmpfwd listening on many local interfaces and you want to distinguish peers based on that.
What you need is snmp-peer-address-pattern-list option where you put a regex matching the source ip:port and coming out with some unique Perhaps you will have multiple instances of Let me know if it's too confusing, I can draft an example. |
I have absolutly no experience using regex but for this i need to filter out 80.244.65.175 and .176 from each other and make them reach different OID and hopefully two different switches.
|
There are any ways how to configure that... Consider this server config, I can't test it, but it should generally work. May be you need to apply the fixes you've encountered earlier.
You'd need to copy and edit one of the |
And the client part leveraging the above server config classification. The goal of the client config is to route SNMP messages coming from server over one of the two backend switches.
Do not pay attention to block names - they are never used for matching. Can be just whatever. |
waow thanks!
|
Oh, pardon my text editing skills! Hopefully, fixed! |
perfect i fixed my config so it looks like your
|
This bit in the log What does the server log on start up related to
|
Here is my config
This is the startup from peer ID
|
Perhaps trailing
|
yea that did ti and both client and server starts propperly now.
And client output
|
Just spotted a duplication in client conf:
Let's rename block name peer-175 -> peer-176 just in case. |
Is this the complete line from the log? It seems to miss some attributes... |
So let's update client conf - I've updated it up in this thread. |
One more change to the client config please - we need to remove regexp anchors:
Should be:
|
That did the job! |
So I hope you are all set by now. Feel free to open an issue if you run into anything later on. |
Hi! So I'm trying to configure OIDfiltering to be able to restrict users in the MIBtree based on both their IP and community string. I have a Proxy behind a firewall. The firewall redirects the traffic to the proxy. I'm having problem getting respons from my manager (with public IP) when I'm running this line.
This is the respons from that.
If i run this command from the proxy i get respons but can i query any OID i want so the filtering doens't work
but with -v1 i get
I don't know If I've missunderstood the config or what it is.
This is my server conf
And my client conf
The text was updated successfully, but these errors were encountered: