Is there any method (via CLI) of knowing if the server I'm at has IPv4 or IPv6?
EDIT: As for the reason why I'm asking this question (apologies if I wasn't specific enough), I'm referring to this guide by my host (Linode).
Specifically, they say (under the section about updating /etc/hosts) that:
"If you have IPv6 enabled on your Linode, you will also want to add an entry for your IPv6 address […]".
So, I'm simply wondering if and how you can figure this out via commandline. (My OS is Ubuntu 11.10 Oneiric.)
UPDATE: Apart from ifconfig, it seems the ping6 utility might prove useful, as hinted to in this article.
It's not a "one or the other" option. You can query the network stack from the command line (see below) and this will return what IP addresses are assigned to each network interface, and you can then see from the format of these addresses which type they are.
ipconfig
for windowsifconfig
for most *nixBe aware that just because an address is there, it doesn't mean that it's in use. Many modern operating systems will assign a link-local address to any active network adapter by default these days.
ifconfig will help you:
You will see something like this, the ipv6 addr is what matters and Scope in the same line. If you see there Site then you have IPv6 routed address. (Link means only link local address.)
Your system will almost certainly have IPV4. You don't say which OS. You can use
ifconfig
in linux to get and look for aninet6
lineor you can use
ipconfig
under windows and look forIPv6 Address
in the output.