Menu
  • HOME
  • TAGS

Why does IPAddress.MapToIPv4() throw ArgumentOutOfRangeException?

.net,ipv6,ipv4,bcl,bug-reporting

Ok, I've actually verified this, so let me post this as an answer. The IPAddress class has an error when mapping the address back to IPv4. According to the .NET reference code, it does this: long address = (((m_Numbers[6] & 0x0000FF00) >> 8) | ((m_Numbers[6] & 0x000000FF) << 8)) |...

Make docker use IPv4 for port binding

ubuntu,docker,port,ipv6

As @daniel-t points out in the comment: github.com/docker/docker/issues/2174 is about showing binding only to IPv6 in netstat, but that is not an issue. As that github issues states: When setting up the proxy, Docker requests the loopback address '127.0.0.1', Linux realises this is an address that exists in IPv6 (as...

Get IPv6 prefix using perl

perl,ipv6,prefix

There are many modules that can do this. I would suggest Net::Works or NetAddr::IP. With Net::Works: use v5.16; use Net::Works::Network; my $network = Net::Works::Network->new_from_string( string => 'FE80:0202:B3FF:FE1E::/56' ); say $network->first; This will output fe80:202:b3ff:fe00::....

Is inet_pton() broken for some IPv6 addresses that “look like” IPv4 addresses?

php,ipv6

Answers provided by kasperd, diskwuff, and JC Sama offer both helpful information and workarounds which are likely to be useful to other SO readers, so I have upvoted them all. But they do not address my original question directly, so I'm adding this answer: The behavior of the PHP function...

Protocols and standards that take advantage of the huge IPv6 address space [closed]

networking,protocols,standards,ipv6

Probably not completely on topic here, but I'm going to answer it anyway because it might help software developers to learn what possibilities there are when developing for IPv6. Because most protocols and applications still want to be compatible with IPv4 there aren't that many protocols that use this wonderful...

Finding active IPv6 interfaces under Mac OS (using Python)

python,linux,osx,ipv6

Under Linux there's no guarantee that your first Ethernet interface will be named eth0. It might be named p1s3 or em1 or even internal. Or bob. Under both Linux and OS X you can use the netifaces python module to get a list of available interfaces and addresses associated with...

Convert IPv4 to IPv6 manually

.net,sockets,converter,ipv6,ipv4

The C0, A8, 19 and EA are just 192, 168, 25 and 234 displayed in hex. The FE80 is a well-known prefix for link local. The rest is always all zero in this case (or for the terse form: can be omitted). Concatenate: job done.

How do I compare IP addresses in PHP as binary strings?

php,ipv6,ipv4,inet

After much troubleshooting, I discovered the cause of this issue. When using the unpack function, I had used the format code "A4" which is for space-padded strings. This was causing anything ending with the number 32 to get treated as whitespace, which would then be trimmed. For example, after unpacking...

Exception IP6 has no attribute

python,filter,version,ipv6,dpkt

Finally i found the good way to do it, the line is not: if ip.p == dpkt.ip6: return But: if eth.type == dpkt.ethernet.ETH_TYPE_IP6: return ...

MaxMind GeoIP2 no results for IPv6?

php,ipv6,geoip

Not every IP address is associated with a time zone. This is particularly an issue for IPv6 addresses where the geolocation data is more spotty. Given that you are getting a record back, I'd suspect that the IP only has country-level data without a time zone. You could add an...

Access IPV6 with IPV4 [closed]

ipv6,nat

you can setup an IPv6 tunnel from your home to some IPv6 tunnel broker and access the centos server on its public IPv6 address; the tunnel broker from he.net works pretty good: https://www.tunnelbroker.net/ if you would not be able to setup such a tunnel from your local machine, theres IPv4-to-IPv6...

Wireshark Capture Filter - IPv4 and IPv6

networking,tcp,wireshark,ipv6,ipv4

If by "neighbour discovery protocol" you mean the IPv6 Neighbor Discovery Protocol in RFC 4861, then it uses ICMPv6 packets, so "only capture ICMP (both for IPv4 and IPv6) and ARP and neighbour discovery protocol packets" is equivalent to "only capture ICMP (both for IPv4 and IPv6) and ARP packets"....

ipv6 python sockets not working

python,sockets,ipv6

The problem is that your server is listening on localhost ::1 but you are trying to connect to 2015:cc00:bb00:aa00::2 which is a different Interface. Try setting HOST = "::" in your server in order to have it bind to all interfaces.

Regex that makes IPV6 addresses shorter

regex,bash,shell,ipv6

Talked about it in the comments, but it works now so here's the answer. /(^|:)0{1,4}/g That regex should work....

JavaScript change IPv6 into IPv4? [duplicate]

javascript,php,ipv6,ipv4,data-conversion

Just for kicks I did it in PHP too:) Explaining the PHP a bit more: I use inet_pton to get a binary value, then by using OR and bit shifting I build a new long values (4 bytes). Since inet_pton returns a structure, I use ord to get the decimal...

My Websocket takes forever to connect

java,websocket,glassfish,ipv6,tyrus

So the cause of the troubles is the initialization of an InitialContext by Tyrus in order to re-use a (scheduled) executor service if one is available. Normally this fails fast if none is available (and this is logged as a debug-message, see further on), but in this case it failed...

Go to convert ipv6 to ipv4

go,ipv6,ipv4

What you're asking is not generally possible. While there is a scheme to represent IPv4 addresses in IPv6 using the ::ffff:0:0:0/96 prefix for use in stateless network traffic translation, the reverse is not generally possible. Since an IPv6 address is 128 bits long, it would be impossible to uniquely represent...

uWSGI --http :80 doesn't listen IPv6 interface

http,python-3.x,ipv6,uwsgi

In your INI config file specify something like this [uwsgi] socket = [::]:your_port_number Or from the CL, ./uwsgi -s [::]:your_port_number The server shall now listen along all the interfaces (including IPv4, if the underlying OS supports dual stack TCP sockets) ...

python ipaddress()reverse_pointer equivalent for 3.4

python,dns,ip,ipv6

You can simply download the source code of Python 3.5 and copy-past the function you need, def _reverse_pointer(self): """Return the reverse DNS pointer name for the IPv6 address. This implements the method described in RFC3596 2.5. """ reverse_chars = self.exploded[::-1].replace(':', '') return '.'.join(reverse_chars) + '.ip6.arpa' Which can be used as...

Java off-heap memory leak in program checking for IPv6 network interface

java,memory-leaks,ipv6

This is a known bug in Java with NetworkInterface.isLoopback(). It is fixed in Java 7 (u60) and Java 8 (b105) and will not be fixed in Java 6. Probably, my client doesn't really need to check whether an IPv6 interface has suddenly appeared or disappeared, and can just check once...

python ipv6 to cidr gives wrong mask

python,ipv6,cidr

The /128 is correct. You didn't specify the prefix length in your input so the code had to guess what you meant. The guess it made is the most correct one: a single address as might for example be used on a loopback interface. Showing a /64 would have been...

Store IP into mysql database

php,mysql,ip,ipv6,ipv4

For handling and storing both IPv4 and IPv6 addresses, you can use datatype VARBINARY(16). In version 5.6, MySQL (finally!) introduced conversion functions for IPv6 addresses: INET6_ATON, so you don't have to do the conversion in your application. If you are handling only IPv4 addresses, you can continue to use the...

Golang Net.IP to IPv6 (from MySQL) as Decimal(39,0) Conversion?

mysql,go,ipv6,ipv4

Thanks to the people in #go-nuts, the answer is as follows: func ipv6ToInt(IPv6Addr net.IP) *big.Int { IPv6Int := big.NewInt(0) IPv6Int.SetBytes(IPv6Addr) return IPv6Int } The same works for IPv4, just do IP.To4() first. ...

Convert from MAC to IPv6

ipv6

Conversion step by step from a MAC address (48 bits) to a IPv6 address (128 bits): take the mac address: 52:74:f2:b1:a8:7f throw ff:fe in the middle: 52:74:f2:ff:fe:b1:a8:7f reformat to IPv6 notation 5274:f2ff:feb1:a87f convert the first octet from hexadecimal to binary: 52 -> 01010010 invert the bit at index 6 (counting...

converting char* to array of uint8_t (c)

c,char,ipv6,uint8t

#include <stdint.h> #include <inttypes.h> ... char *buffer="dddd:0000:0000:0000:0000:0000:0000:cccc"; uint8_t ipadress[16]; sscanf(buffer, "%2" SCNx8 "%2" SCNx8 ":" "%2" SCNx8 "%2" SCNx8 ":" "%2" SCNx8 "%2" SCNx8 ":" "%2" SCNx8 "%2" SCNx8 ":" "%2" SCNx8 "%2" SCNx8 ":" "%2" SCNx8 "%2" SCNx8 ":" "%2" SCNx8 "%2" SCNx8 ":" "%2" SCNx8 "%2" SCNx8 ,...

Is the IPv6 case sensitive

ipv6

The IPv6 Address represents hexadecimal digits, which in it's turn is just a bunch of numbers so no, it is not case sensitive.

Docker 1.5 on IPv6 only host

routing,docker,ipv6

It is not recommended to do any kind of NAT in IPv6 environment, that defeats the purpose of IPv6. You can accomplish access to the container through IPv6 using pipework. Pipework allows more flexible network configuration: sudo docker run -t -i --name myimage <image id from `sudo docker images`> /bin/bash...

IPv6 address representation in Python

python,ipv6

The POSIX page for inet_ntop specifies that format as one of the options (slightly paraphrased): A third form that is sometimes more convenient when dealing with a mixed environment of IPv4 and IPv6 nodes is x:x:x:x:x:x:d.d.d.d, where the x characters are the hexadecimal values of the six high-order 16-bit pieces...

Collect user's IPv6 or MAC address on website hosted with Python HTTP Server with CGI

python,html,cookies,cgi,ipv6

When using CGI, the web server will pass the user's IP address to your script in the REMOTE_ADDR environment variable. So you can simply check this variable. remote_ip_address = os.environ['REMOTE_ADDR'] A tuple containing the remote IP address and port can also be obtained from the CGIHTTPRequestHandler that you created. remote_ip_address_and_port...

IPv6 vs IPv4 connectivity load

linux,sockets,redhat,ipv6

IPv6 on RHEL5.0 cannot handle load. Requirements for our app moved up to RHEL 5.3.

Python 3 - Cannot receive IPv6 packets (UDP - linux)

linux,sockets,python-3.x,udp,ipv6

You're trying to bind to a link-local address but you have forgotten to include the scope ID (in this case, %eth1). So you should be binding to address fe80::fab1:56ff:fe9a:cfef%eth1....

Subnet mask returned from WMI not accepted in postgresql

postgresql,wmi,ipv6

/64 is a valid subnet mask (well-known a prefix length, technically) for an IPv6 address. Based on your error message the problem is that you're not putting an address plus subnet mask in the inet field but only the prefix length. I get the feeling that you are using the...

EndPoint Communication Exception with correct DNS IPv6 address but incorrect IPv4 address

.net,wcf,dns,ipv6,ipv4

A well behaved client would try each individual DNS recursor before it gives up and give you the The remote name could not be resolved error. So in the scenario where you have configured the client with an incorrect IPv4 address and a correct IPv6 address for the recursor, it...

Connecting to MySQL (on Google Cloud SQL) via JDBC and IPv6?

jdbc,ipv6,google-cloud-sql

You need to register the IPV6 address from which you'll be coming into Google Cloud SQL, among the authorized addresses on the Cloud SQL console. You can check that IPv6 address e.g by visiting sites such as whatismyv6.com . Then, all your ISP has to do is to provide a...

PHP - using multiple IPv6 addresses to connect with remote server

php,linux,http,ipv6

Have you tried setting CURLOPT_INTERFACE? The name of the outgoing network interface to use. This can be an interface name, an IP address or a host name http://www.php.net/manual/en/function.curl-setopt.php...

IPv6 Abbreviation(zero blocks compression) logic. I'm using c#

c#,ip,logic,ipv6,abbreviation

Was far more tricky than I expected, but here you got the way to do it with regular expressions: private static string Compress(string ip) { var removedExtraZeros = ip.Replace("0000","*"); //2001:0008:*:CD30:*:*:*:0101 var blocks = ip.Split(':'); var regex = new Regex(":0+"); removedExtraZeros = regex.Replace(removedExtraZeros, ":"); //2001:8:*:CD30:*:*:*:101 var regex2 = new Regex(":\\*:\\*(:\\*)+:"); removedExtraZeros...

Find IPv6 global scope address on Android device

android,ipv6

What you need to check for is that the first address word is 4 characters and the first character is a 2 or a 3. If the array element meets those two conditions, it is a global address. You can then clean up the surrounding garbage to get a valid...

Cannot ping the other side of an OpenVPN tunnel (IPv6) [closed]

ipv6,openvpn,iproute

Jeremy is about right. It is an anycast address. Since it is not really meant to ping/connect to the other side, the right thing to do is to not use the address at all: ip route add fd94:a10e:82b8:8::/64 dev tun0 ip route add 2000::/3 dev tun0 Now we could e.g....

IPv6 multicast regular expression in JS example?

ipv6,multicast

You can simply check that the IPv6 address is valid, and located in the ff00::/8 network (RFC 4291 § 2.7). An address matching both criteria is a valid multicast address.

An address incompatible with the requested protocol was used?

c#,ipv6

IPv6 link-lical addresses are valid on every link, so you need to tell the system which link to use. That is usually done by appending % and the interface id to the address. Using global addresses is usually easier.

Scope ID in python ipaddress.IPv6Address instances

python,ipv6,link-local,scope-id

I recommend using the same structures as the Python socket module in all those cases where this makes any sense. Even if using your native library means the Python socket module isn't going to be used, it can still be beneficial, if some data structures are compatible between the two....

mysql storing ipv6 address with foreign key constraint

mysql,ip-address,ipv6

Well, after researching a lot... I have simply decided to just use one column of VARBINARY(16) to store IPv4/IPv6 address and use it as PRIMARY KEY instead of 2 BIGINT columns just because its a bad idea to break a simple IPv6 address into two separate columns for manageability purpose....

Cannot SSH to IPv6 address

ssh,ipv6

It is working now, it is a firewall issue.

Adding an ipv6 address to “require ip” in phpmyadmin.conf in linux

linux,ipv6,centos6

The supported syntaxes are, for Apache 2.2 and 2.4 respectively: Allow from 1111:2222:3333:4444::/64 Require ip 1111:2222:3333:4444::/64 The syntax you were trying was probably missing the terminal ::, which was causing the base IPv6 address to be invalid. (It'd be comparable to trying to write 1.2.3/24 instead of 1.2.3.0/24.)...

How to access a ipv6 address using windows command?

windows,shell,cmd,ipv6

If I put http://2607:f8b0:4006:808::1012 into the address bar of Google Chrome on Windows 7, it doesn't work (it searches for the "phrase" on Google). Likewise for IE. So I got to thinking, maybe your syntax is wrong, and it's not Explorer's fault. And I found this: https://productforums.google.com/forum/#!topic/chrome/n3jUQROi1cA Which says you...

Disable ip v6 in docker container

docker,ipv6

Unfortunately there isn't: --ipv6 is a daemon-wide flag that cannot be overridden on a per-container basis.