How to send an snmp request to any computer on LAN? - snmp

I want to build an application using snmp for searching my LAN and exploring the devices which have shared some resources. I need some assistance to start with it, I have trying to do the same using net-snmp, but still no success.

SNMP is on UDP, so you can simply do a broadcast.
It is quite normal that net-snmp times out in such cases, as no SNMP agent would like to respond to you or no SNMP agent is there in the same LAN.

Related

How to redirect network traffic to a tcp/udp connection in golang

So I've seen projects like trojan-go,v2ray-go
They are making their own proxy protocols in user space level. I am trying to do the same thing but I don't know how to redirect network traffic from clients to proxy server.
Basically I don't understand how those tools (or any tool) can redirect internet traffic of the device to a certain server, so when the packets are going to the internet they go to the proxy server first instead of their destination ip address.
How can I do it in golang without dealing with netlink and Iptables?
I know apps like wireguard do this by dealing with layer 3-4 stuff using netlink API but I need to know how apps do it without adding a new network interface.

Stream real time video from local IP to browser in an external network using websocket/webRTC with raspberry pi 3b+

Anybody here with some experience in websockets and webRTC using TURN/STUN servers?
Requirement:
Send real-time video feed from local IP to browser in an external network and I need some help implementing via raspberry pi 3b+. My camera source is android device, and using 3rd party apps I am able to generate the video feed over local network. Using the same app I can stream via Youtube Live,but getting a latency of about 2 secs in ultra low latency mode and dvr enabled. And I am trying to reduce the latency of the stream.
Q1. Do the semi-public TURN server provide a one to one peer. Or anyone can just jump into the URL and view and override what I am streaming?Please provide few list of service providers.
Just for information there would be 1-2 users browser connected at max.
Q2. Do I need Janus gateway to send webRTC/websockets data into the TURN/STUN server? Since my raspberry is connected to a different network and I cannot port forward due to carrier constraints.
Q3. Do I need both STUN/TURN servers or do I even need webRTC instead of websockets to send my video stream over the internet. Is websockets not sufficient?
Q4. Since we are not implementing over local network do we need to install coTURN too on raspberry pi?
Q5. Is there any android app that can publish the data from camera to websocket/werRTC server with a public ws URL?
Any help would be really helpful.
Q1. TURN servers relay media. They do this by allocating for every connecting peer a relay port between 49152–65535. This relay port will then be used to transmit the media to the second peer. The peers will know which relay ports to use automatically since this is part of the ice gathering process. To get back to your question: Other Peers cannot write to that relay port, it is 1 to 1 with handshakes, there is no chance of someone else overwriting it.
Q2. You definitely do not need a Janus Gateway to use TURN. TURN and STUN will probably work fine for NAT-Traversal without port forwarding.
Q3. You need at least a TURN server (but you ideally want to use 1 STUN server and 1 TURN server). STUN will work in most cases, but will fail if there are firewalls or complicated NATs, which block inbound udp connections. TURN is just the fallback for those cases.
Needing WebRTC? For just streaming videos, it depends on the use case. A sequence of images can be transmitted over websockets, they can handle Blobs fine. But you won't have a very fluent, high fps AND high resolution video stream this way. And of course, I know of no usable way to transmit audio over websocket.
Q4. The raspberry pi is a Peer that transmits media? Peers do not need a local TURN server installation, you will only need 1 TURN server (which should not be behind a NAT, probably running on some web server). The TURN server is a separate instance.
EDIT
For your private testing and development purposes, you may use https://numb.viagenie.ca/ . I don't know much about commercial turn server hosters, except that some exist. For someone who owns a v-server or root server, installing coTURN may be an option, this Tutorial might be helpful. To check if the server is working, I also found this snippet to be very useful.
END EDIT
Q5. There is no android app that publishes webRTC streams to a ws URL since websocket
messages are used by webrtc only for signalling (that is, telling peers their host candidates, those are the IP adresses and ports learned by the ice gathering process, this includes the TURN and STUN ip and port combinations).

Can I send SNMP Traps to a different network?

I'm trying to send and receive an SNMP trap using an Ubuntu VM. Works well if I send and receive it in the same VM. But is it possible to send it to another Ubuntu VM in a different network or sending it through the internet?
Used a ton of tutorial like this but with no luck.
Any tutorials or guides for this? Been searching for days. Any help would be great. Thanks!
Yes, of course, but you will need to open up your firewalls and/or set up port forwarding so that the packets go where they need to go when they cross any network boundaries. The specific details depend on your network layout and cannot be further explained in the abstract.

How SNMP agent gets data from snmp devices will work c#

I've been looking around the net for a guide or tutorial on how to start on using C#.NET to query SNMP devices but I have been unsuccessful.
I am using Sharpsnmplib because of MIT license.
I didn't understand about the flow of data that how devices will communicate with SNMP agent, is there any event for which agent will listen. How devices send traps to agent and then to manager.
What is v1, v2c and v3.? Is this device configuration.
I guess I have to create some window service and periodically (timer based) execute SendTrapV1 method and in another service(SNMP manager) I have to listen to these traps.
My requirement is to identify the antenna level trap of Impinj Reader and have many SNMP devices in the network.
I have to implement also auto-discovers facility to discover SNMP devices installed in the network.
Any project or code will be helpful in this case.

Programmable router

I'd like to set up a proxy between my home network and internet.
Currently computers at home connect to a cisco router which is connected to internet.
What I'd like is to set up system so that all internet traffic goes through a proxy - in my case it is a dedicated extra computer (server).
Are there programmable routers that can run some software within the router or using a connected computer?
This way I could use a program to see what goes out and comes in.
If you only want to monitor your network then investigate and learn how to use WireShark. If you want to take the long and much harder route of making a proxy server, use a squid proxy. It runs on a Linux server and you can get a lot of user friendly GUI's. Plus there are hundreds of tutorials.

Resources