1

I have IPv6 setup on Linux however it is not using IPv6 by default unless I specify it. For example:

ssh -v HOSTNAME

I see ssh connecting to the IPv4 address. The only way I can get it to use IPv6 is if I:

ssh -6 HOSTNAME
-or-
ssh IP::v6%INTERFACE

I use the same exact host on a Solaris box and IPv6 works fine.

Solaris:

nslookup host1
Server:         10.1.44.100
Address:        10.1.44.100#53

Name:   host1.sc.somehost.net
Address: 10.1.42.37

dig AAAA host1.sc.somehost.net

; <<>> DiG 9.6-ESV-R8 <<>> AAAA host1.sc.somehost.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 4583
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 5

;; QUESTION SECTION:
;host1.sc.somehost.net.      IN      AAAA

;; ANSWER SECTION:
host1.sc.somehost.net. 3600  IN      AAAA    2600:REST_OF_PREFIX:2::37

On Linux the output is the exact same.

There is no /etc/gai.conf on my Linux host. On my solaris host I do have the following in my /etc/nsswitch.conf (which I was told "turns on" ipv6 by default.

 ipnodes:    files dns 

Just for kicks my IPv6 linux config is as follows:

 bond0     Link encap:Ethernet  HWaddr NOPE 
      inet addr:10.1.44.194  Bcast:10.1.45.255  Mask:255.255.254.0
      inet6 addr: 2600:REST_OF_PREFIX:1::44:194/64 Scope:Global
      inet6 addr: 2600:REST_OF_PREFIX:AUTOCONFIG_MAC_ADDR_ADDRESS/64 Scope:Global
      inet6 addr: fe80::NOT_GETTIN_MY_MAC/64 Scope:Link
      UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
      RX packets:1197675 errors:0 dropped:569214 overruns:0 frame:0
      TX packets:878545 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:447693586 (426.9 MiB)  TX bytes:793250645 (756.5 MiB)

Thanks for the help guys.

4
  • 2
    It's probably related to DNS - do an nslookup on HOSTNAME and tell us what comes back. Do the same thing for the Solaris box so we can see the differences in behavior.
    – mfinni
    Aug 8, 2013 at 17:24
  • 2
    Using IPv6 is the default. In addition to posting a host lookup for the address, please also post the contents of /etc/gai.conf. Aug 8, 2013 at 17:26
  • You say linux but you don't say which distribution. Might be helpful. Aug 8, 2013 at 17:48
  • Sorry. It's Oracle Linux (Basically RHEL6) Aug 8, 2013 at 17:53

1 Answer 1

1

There are (older, I hoped) versions of Linux in which RFC1918 IPv4 address space is preferred over IPv6. See for example debian bug #428434 libc6: Resolver prefers IPv4 to IPv6 in some cases. You probably don't have a /etc/gai.conf file to fix this, this only came in newer versions.

1
  • The bug says this was fixed in glibc 2.5. RHEL 6 has glibc 2.12. Aug 12, 2013 at 14:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .