How to use net-snmp 5.5 with IPv6 on Linux? - linux

Does the Linux SNMP agent support IPv6? I'm working with net-snmp 5.5. It's working fine with IPv4 address set and get operations, but with an IPv6 address it leads to unknown host.
What's the problem, and how do I resolve it?

Happened to come across this question while searching for something else and figured I could add my 2 cents.
The IPv6 address in a net-snmp command is a little different from an IPv4 address. You need to use the udp6: prefix and specify the port number.
"udp6:[<ipv6 address here>]:161"
The full command should look something like this:
snmpset -v 1 -c private "udp6:[<ipv6 address here>]:161" 1.3.6.1.4.1.318.1.1.26.4.4.1.4.1 i 7
edit: this works for a Windows environment, but may be the same for Linux

In addition to listening for udp6 packets, it also seems you must specify an additional, separate community for ipv6 requests. Without both changes to snmpd.conf snmp queries via ipv6 are ignored.
agentAddress udp:161,udp6:161
rocommunity6 public default

Related

logstash http-poller input force ipv6 usage?

I would like to force the http_poller to use ipv6 first prior to ipv4.
The host running logstash is dual stacked and the target host also.
The issue lies in the ACL on the target host only accepting requests from the IPv6 addresses on the vhost configured.
curl works as it is default ipv6 first if dual stacked and ipv6 addresses are returned by dns (but also ipv4).
When in touch with the supplier of the endpoint it seemed that we are going over ipv4 when using the http_poller input from logstash iso ipv6, I see no options in the plugin to force ipv6 and the supplier is not going to change its dns, nor allowing our ipv4 address.
I know that I could create a workaround with having an exec input that handles the request, but I consider this only as a last resort.
Someone who has an idea on how to solve it?
Update: I already looked into the info of manticore http client, but did not find a solution there (thanks Badger for reminding me to share the fact that I already looked into this)

Fundamental Networking Understanding

treading some unfamiliar waters. I'm currently writing a game client in Unity/C# and a game server in NodeJS. I've been doing a lot of Googling to try and get some answers, but there are some fundamentals I'm definitely not understanding. From what I understand, there are three relevant IP addresses here: my external IP address, 127.0.0.1, and 0.0.0.0. I've tried every permutation of these for client and server (with or without common sense), and the only combination that works is 127.0.0.1 x 127.0.0.1. I assume ultimately that the server will need to be on 0.0.0.0, but currently Unity errors out because the socket is already in use by the server- I assume that this would not be an issue with remote hosting.
My questions are:
Is it possible to host this on my home computer without socket overlap? Virtual machine?
Why does 127.0.0.1 x 127.0.0.1 work? Does the client convert it to another local address under the hood? I assume that they would both be UDP/127.0.0.1/port sockets.
I'd like to put the multiplayer into this game as soon as possible. Thank you!
Yes, it is possible, with virtual hosts, virtual machines. If you are working in windows, take a look at XAMPP or WAMPP if you are in a Mac.
This is a little big larger:
127.0.0.1 is the localhost (basically, yourself) also known as loopback adress.
And 0.0.0.0 is a non-routable meta-adress. Basically it serves to designate invalid targets, it's like a placeholder for "unknown" adresses. Serves to designate invalid targets doesn't means that is an invalid adress!
In your context, if you're using the 0.0.0.0 as a server it means "all IPv4 adresses on the local machine". If a host has two IP addresses, 192.168.1.1 and 10.1.2.1, and a server running on the host listens on 0.0.0.0, it will be reachable at both of those IPs.
This tutorial from Tom Weiland really helps me to learn about on-line programming in Unity, check it out: https://www.youtube.com/watch?v=uh8XaC0Y5MA

Dynamic DNS for IPv6 results in IP address could not be found

I am trying to switch my dynamic DNS from IPv4 to IPv6, but I am encountering a strange issue. The device is accessible via its raw IPv6 address, but whatever dynamic DNS server I use, it always results in an IP address not found issue. The IPv4 one works fine though. The server is also correctly configured, otherwise the raw address would not work.
What is even stranger is that services like http://ipv6-test.com seem to be able to verify that IPv6 functionality exists and also which web server I use. They also list the corresponding name servers.
I tried the dynamic DNS services of spdyn, dynv6, and ddnss. I also tried noip, but it seems they only support IPv4 for free. (My IPv4 one is with noip.)
Does anybody have some advice? I'm thankful for any help!
Most probably your network is not supporting IPv6.

How to disable ipv6 adrress resolve in DNS

I want to disable ipv6 resolve.
When I do nslookup for host name it is giving 2 ip addresses i want to disable ipv6 address permanently. I'm using im6q sabrelite board yocto build.
Linux version is 3.14
nslookup c1457415477.mgr.gcsp.cddbp.net
Server: 172.16.1.90
Address 1: 172.16.1.90 hobbes.local
Name: c1457415477.mgr.gcsp.cddbp.net
Address 1: 209.10.41.84 service.gracenote.com
Address 2: 64:ff9b::602e:9622
Thank you for your time.
The IPv6 answer you see is from a DNS64 resolver. That would indicate that IPv6 is important on that network (and that the network might go IPv6-only) and you're better off not disabling it.
That aside, if you really want to filter out IPv6 results I think the only option you have is to run your own DNS resolver where you filter out all AAAA records. This is not easy and will likely break things. See https://serverfault.com/questions/554085/can-i-configure-a-dns-cache-not-to-forward-aaaa-queries for more information.

Same server, same program but started once using one network card and after with another

I have a Linux server with multiple ips (so, multiple eth0, eth0:0, eth0:1 etc).
The script I'm trying to start is a php CLI script which is downloading stuff from an another server API, and I would like to change the IP based on different parameters. Once the script is started, I don't need anymore to change the ip OF THAT SPECIFIC script until his end.
Do you have any clue if it is possible to achieve it?
My other solution was to install Xen or OpenVZ and create N different VPS per each IP, but as you can see is definitely a PITA :-)
You don't specify how you connect to the other server, but with sockets you can try socket_bind.
EDIT:
With curl you can try curl_setopt.
CURLOPT_INTERFACE The name of the outgoing network interface to use. This can be an interface name, an IP address or a host name.
I know how to do it in C - you use bind() on your socket before you call connect(), and you bind to the IP address assigned to the desired interface, passing 0 for port. I don't know how to do it in PHP.

Resources