I'm adding GeoIP tracking to WCF Web Service using MaxMinds' GeoIP Lite Country. All works well for their IPv4 database but they don't give any samples to calculate an IPv6 IP Number. I've contacted them and they said to use a search engine.
Anyone have a sample they're willing to share? Any language will do.
Its not a duplicate question per se, but from here:
There is no IPv4 to IPv6 mapping that
is meaningful. things like 0.0.0.0 and
127.0.0.1 are special cases in the spec, so they have equivalent meaning.
But given an IPv4 address it tells you
nothing about what its specific IPv6
address would be. You can use a DNS
lookup to see if a given IP address
resolves to a host which in turn
resolves to an IPv6 address in
addition to an IPv4 address, but the
DNS server would have to be configured
to support that for the specific
machine.
Related
Hello guys I got a problem with IPV6 that my ISP give me. I don't really familiar with the IPV6 and this is the info that he gave me.
2001:0E68:5845:7500::/56
2001:0E68:5810:0B23::/64
what are those mean? can I use it to host a web server? can I use it on my DNS like Cloudflare?
/64 1 IPv6 subnet
what does that mean by 1 ipv6 subnet? what is the full address of that ipv6?
and this
/56 256 LAN segments
is it only used by LAN, not on WAN? what I mean is it's like we set up a webserver some IPV4 of our WAN will use at DNS for pointing that domain to ipv4. am so confusing right now please help me explain it to me.
You will typically only use standard /64 networks with IPv6, else you will break some IPv6 features (/127 for point-to-point networks and /128 for loopback addresses are the exceptions).
Your ISP is assigning the /64 network as a transit network to reach your site. The /56 prefix is a delegation, and your router should be able to automatically delegate /64 networks for the individual networks in your site.
The 2001:0E68:5810:0B23::/64 is the full network address for the transit network between the ISP and your site, and you do not normally advertise or use this network in DNS.
The 2001:0E68:5845:7500::/56 is the delegated prefix from which your router can delegate individual standard /64 networks for use within your site. You can use one of the /64 networks to derive your /127 point-to-point and /128 router loopback addresses.
Search for IPv6 Prefix Delegation.
Because these are Global IPv6 addresses, you can assign them to DNS AAAA records. You need to make sure your ISP allows any services you want to provide (very likely with such an address allocation) and be sure to allow any public services (including requests) through your firewall.
This is from my lecture slides in the web based systems section of Distributed Systems:
Which of the following hostnames are valid?
122.65.132.11.1.97
My_server
300.320.1.32
The answer is: All three can be valid depending on the scheme used.
I would have thought the answer would be that none are valid; can someone explain why all three could be valid?
First: the ip address is the actual name of the host. Everything else is DNS entry that maps to the ip address.
122.65.132.11.1.97 is a valid IPv6 ip address.
My_server is a valid DNS entry (which presumably could map to a legit host).
Corrected:
300.320.1.32 is a not a valid IPV4 ip address.
For the idea of private, I mean it like 10.*.*.* idea of ipv4. It seems ipv6 don't conserve ip addresses like these any more.
So, what if I want to create a private subnet which I don't want the others to know my subnet number or access my subnet with ip address. I can create my own range of ip subnet number, but it seems in that way, it would conflicts with global ip address.
I know the idea of link local address, but I think that's useless when I want several links to constitute a network.
If you are just setting up a private local network for development/testing and don't have any actual IPv6 connectivity of your own (or your ISP is stupid and only gave you a /64) then unique local addresses will work fine for you.
However, unique local addresses cannot be used for connectivity to the global Internet. If you need this, you should get global addresses and a proper firewall (as NAT is not needed and strongly discouraged in IPv6).
To get a /48 ULA prefix, visit this generator and throw in a MAC address. (Using a MAC address to generate the prefix is specified by RFC 4193, which defines unique local addresses.)
I have a ipv4 client/server network application written in Qt (v4), which i have to port it in ipv6 (actually the client porting is the most important one), creating in this way a dual-stack ipv4 & ipv6 application.
i do not have any ipv6 network available so as to perform any tests.
i tried the following but with no success:
find a tool that make ipv6 validation: there are not many, usually poorly documented and usually for C language
create a local ipv6 network environment
any ideas?
Definitely create a local IPv6 network environment. A lot of things work the same in IPv6 as in IPv4, but a lot of other things are different. When developing applications that use IPv6 you should have some hands-on experience. You wouldn't expect someone who has never used IP to develop an application that uses IPv4, would you?
Some key differences:
IPv6 addresses are written in hexadecimal
IPv6 hosts will probably have multiple addresses
An IPv6 address that starts with fe80:This is the link-local address. Every IPv6 hosts has one for every interface it has. Link-local addresses exist on every link (ethernet segment, LAN) and they use the same address range on each LAN. It is therefore impossible to route them, but they are very useful when communicating only within the LAN.
One or more IPv6 addresses that start with something in the range 2000: - 3fff:These addresses are the globally routable addresses that you use for normal internet communication.
Zero or more IPv6 addresses that start with something in the range fc00: - fdff:These are Unique Local Addresses (ULA). They are routed within the house, building, organisation etc. They are not routed to the global internet so you cannot reach public services with them.
And of course maybe one or more IPv4 addresses
NAT is (almost) never used with IPv6. ULA addresses are not NATed to a public address.
The best way to get experience is to use an IPv6 connection that is connected to the real IPv6 internet. If your ISP cannot provide you with IPv6 (they should these days, but many ISPs are still slacking) you can use a tunnel broker service like SixXS or Hurricane Electric. They will give you an IPv6-over-IPv4 tunnel with a /48 of addresses. That is enough for 65536 subnets of 2^64 hosts. More than enough for a development network :-) SixXS has the benefit that they provide client software that can run behind a NAT router. Hurricane Electric has the benefit that the registration procedures are much easier.
I'm working with Microchip's TCP/IP stack and the host name of my device is not being broadcasted, although I can access it using its DHCP assigned IP.
So the question is, what is the protocol that a network device uses to broadcast its host name, so that when I see a list of devices in a network I can identify it by name?
Is it the NetBIOS name service or something else? Thanks in advance.
The most network-agnostic way to specify a hostname for a host on the network is through DNS, which your device itself cannot control, but all is not lost.
In most environments, the DHCP and DNS servers are tied (AD in Windows networks, DNSMasq on linux, etc...) so your best option is to rely on this behaviour. When you request an IP using DHCP, the DHCP protocol allows you to specify the hostname you'd like to use and if the network is set up to allow DNS entries to be created and maintained by the DNS server, the hostname you send during your DHCP request will typically be used.
The DHCP parameter is called 'Hostname'. The Network protocol documentation for this parameter is located in RFC 2132, and explained here.
There is WINS (based on NetBIOS) that supports this functionality.
There is ZeroConf/Bonjour that offer a "service advertisement" protocol but I am guessing that's not what you are after here.
In "normal" IP based networks, name resolution would go through a DNS layer: the DNS servers propagate their databases (if instructed too of course) but there is no concept of "broadcasting" at this layer.
I guess you've solved this by now but I modified the dchp.c file in the Microchip stack and added the following to the options part of _DHCPSend().
// host name
i = strlen(AppConfig.NetBIOSName);
UDPPut(12); //host name code
UDPPut(i); //length
UDPPutString(AppConfig.NetBIOSName);
This worked for me.