Timeout on SNMP GET / SET using IP address on VPN client on different network - sharp-snmp

I have a SNMP GET timeout issue when trying to get data from an IP on a VPN connection. It seems like the SharpSnmpLib looks for the IP address from the wrong network connection and it times out.
The app is a UWP test to try out Lextm.SharpSnmpLib. I am able to GET a standard OID from 127.0.0.1 but not an IP address over the VPN connection.
Is there some way to direct SharpSnmpLib to use a different network connection or to not use only the default connection?
Here is the code snippet:
var result = Messenger.Get(VersionCode.V1,
new System.Net.IPEndPoint("127.0.0.1"), 161),
new OctetString("public"),
new List<Variable> {
new Variable(new ObjectIdentifier("1.3.6.1.2.1.1.1.0")) },
6000);
The same code when tried to the router in a VPN connection, "10.192.10.1" fails with a timeout message.
Is there a way to configure SharpSnmpLib to look for the IP address in a different network connection, namely the VPN connection?

Related

How Can/Do I [Know] Which IP Address I Want To Reference?

I am not incredibly familiar with NAT / Port Forwarding - I get the concept, but still trying to understand the why of it all. Nonetheless, I am attempting to
Create a Website to get their public IP
Send that IP to another service
Have that service send that IP a request on a specific port
To my understanding, let's say there are 5 devices connected to a single router. When PC1 and PC2 try to ping Google - they both ping from an identical IP, however, a different port from a router. That port indicates to the router that I am requesting to send information to a specific device connected to that router.
TLDR:
How can I obtain a specific IP from a computer that I can use for a different service in the very near future?
Current Attempts:
I have created an AWS Lambda to obtain the Source IP:
exports.handler = async (event) => {
const ip = event["requestContext"]["identity"]["sourceIp"];
const response = {
statusCode: 200,
body: JSON.stringify(ip),
};
return response;
};
But, isn't this for EVERY device behind that router, if it is one? How do I know for sure that I am connecting to a specific device that is behind that router?
Edit 1:
My end-goal was to be able to create a remote connection using RFB provided the users IP Address. I assumed, I could easily be wrong, that I would be able to obtain their IP by having them access a public website that would provide it then I would be able to create that connection.

cannot install ezproxy on ec2 instance

not able to install ezproxy on ec2 instance there seems to be problem because it has a public and private ip.
i used this method for installation from url
https://www.oclc.org/support/services/ezproxy/documentation/download/install-linux.en.html
it fails at step 4 and step 5
error
Checking ability to directly connect to iptest.ezproxy.com
Attempting to contact iptest.ezproxy.com by name
Connection established, sending my IP address (10.135.235.34) for testing
Waiting for response on port 0
The test results follow:
If you are using multiple IP interfaces on your system, some of
the information provided by this test may be inaccurate.
You claim to be ip-10-135-235-34.ec2.internal at address 10.135.235.34
To me, you appear to be 54.242.97.3
Since those don't match, there may be a proxy server between us.
I am now attempting to connect to your server to check for intervening
firewalls. If there is a firewall, this may take a little while.
Trying ip-10-135-235-34.ec2.internal
Connection to ip-10-135-235-34.ec2.internal failed, trying 10.135.235.34
Connection to 10.135.235.34 failed, trying 54.242.97.3
Connection to 54.242.97.3 failed
I am unable to connect to you. There may be a firewall between us.
Your system claims that its host name is ip-10-135-235-34.ec2.internal
That name failed to work, which may indicate a problem or may
have occurred if you have multiple IP addresses on this server.
Is 54.242.97.3 your public ip address? If so, EZProxy should have been able to connect. Double check your EC2 security group to ensure it allows traffic on the ports that EZProxy requires.
If 54.242.97.3 is not your public ip address, you are probably connecting through a NAT gateway. Follow the instructions for setting up EZProxy behind a NAT gateway.

Meteor: Remote MongoDB with dynamic IP

In a local network (over which I supposedly have no control) I need to connect my local instance of a meteor app to a MongoDB that is running on another PC. Using something like MONGO_URL="mongodb://192.168.1.xx:27017" meteor I am able to connect to it; However is there some way to connect when I don't know the IP, given that it may change daily?
What I'm attempting here would be something like:
Meteor.startup(() => {
//Script to find the correct IP
//Connect my app to that MongoDB instance
});
In short: is there some way to set the MONGO_URL dynamically?
Thank you
Use the hostname of the MongoDB server. As long as you have a local DNS server and both computers are using the same DNS server (which is most likely the case unless you have customised the network settings on either PC), the name will be resolved to the IP address.
To get the hostname of the server, type hostname into Command Prompt (or Terminal if on a Mac).
Alternatively, even without control over the network you may be able to configure a static IP address on the MongoDB server as long as you have local administrator permissions. Just make sure it is within the same network range as the rest of the network, but try to steer clear of your DHCP range otherwise you may get IP conflicts.

Connect from specific ip address in linux

I'm writing a distributed system and I want to test it on my machine. I created several ip addresses on the interface lo using ip addr add ip_add dev lo.
I have binded all servers to their specific addresses and now I want my servers to connect to each other such that each server would think that it connects from his own ip. But when I use connect I get connection from my localhost. How is it possible to connect from a specific ip address?
It turned out that calling bind() on my socket does all necessary work.

how to use host name in the place of ip address in the socket programming in java?

I am using socket programming to connect two PCs in java through wi-fi. I used the ip address of the server at the client side. but the problem is that when the ip address of the server got changed then i have to change the ip address of server at client side. and when i use host name for connection nothing happens. is there any way to use static ip or any other solutions that can work to connect both of them which can work on any network. independent of ip address of the server.
please suggest me the solution.
i think there is a simple solution to your problem ...
you should get the ip address of your device by using Inetaddress.getbyName("user-pc").getHostAddress()
hope it will work for u...
1. First of all If you are on LAN, then Any IP from Class A, B, C will suffice, But if you want it over the Internet, then you will have to be careful about the Private and Public IPs.
2. For static IP over internet you need to contact you Internet Server Provider, or you can try out some sites over the net that provides static ip based on your dynamic ips.
3. But if you want that due to the change in your server ip the client code need NOT be changed then you can do the following...
- Use the Domain Name of the Server instead of IP, by using Domain Name Server.
- Instead of storing the raw IP of the Server in the Client code, use Some variable which gets the IP of the server from some file like the Property file, Database etc...

Resources