Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-30-2010, 04:34 PM   #1
Senior Member
Registered: May 2009
Location: WV, USA
Distribution: Slackware, Ubuntu, Amazon Linux
Posts: 1,830
Blog Entries: 21

Rep: Reputation: 119Reputation: 119
referencing hosts by (special) hostname for IPv6 link local address

I can reach other hosts by means of their global addresses by either the IP address or hostname (that has the global address). What I want to (also) do is have a hostname that references the IPv6 link local IP address (an AAAA record in DNS, or just the fe80::<whatever> address in /etc/hosts) and use that host name in commands to access that host. The problem is, an interface ID is needed when making such a reference. So a reference by IP address might look like:
altair/phil /home/phil 1> ping6 -c 5 fe80::215:17ff:feda:dfe9%eth0
PING fe80::215:17ff:feda:dfe9%eth0(fe80::215:17ff:feda:dfe9) 56 data bytes
64 bytes from fe80::215:17ff:feda:dfe9: icmp_seq=1 ttl=64 time=5.74 ms
64 bytes from fe80::215:17ff:feda:dfe9: icmp_seq=2 ttl=64 time=0.198 ms
64 bytes from fe80::215:17ff:feda:dfe9: icmp_seq=3 ttl=64 time=0.192 ms
64 bytes from fe80::215:17ff:feda:dfe9: icmp_seq=4 ttl=64 time=0.179 ms
64 bytes from fe80::215:17ff:feda:dfe9: icmp_seq=5 ttl=64 time=0.147 ms

--- fe80::215:17ff:feda:dfe9%eth0 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3998ms
rtt min/avg/max/mdev = 0.147/1.292/5.748/2.228 ms
altair/phil /home/phil 2> telnet fe80::215:17ff:feda:dfe9%eth0
Trying fe80::215:17ff:feda:dfe9%eth0...
telnet: Unable to connect to remote host: Connection refused
altair/phil /home/phil 3>
The problem is combining a hostname does not work like that:
altair/phil /home/phil 3> telnet bessel-eth1.ll6
Trying fe80::215:17ff:feda:dfe9...
telnet: Unable to connect to remote host: Invalid argument
altair/phil /home/phil 4> telnet bessel-eth1.ll6%eth0
telnet: could not resolve bessel-eth1.ll6%eth0/telnet: Name or service not known
altair/phil /home/phil 5> ping6 -c 5 bessel-eth1.ll6
connect: Invalid argument
altair/phil /home/phil 6> ping6 -c 5 bessel-eth1.ll6%eth0
unknown host
altair/phil /home/phil 7> grep bessel-eth /etc/hosts
fe80::215:17ff:feda:dfe8		bessel-eth0.ll6		bessel.ll6
fe80::215:17ff:feda:dfe9		bessel-eth1.ll6		bessel.ll6
altair/phil /home/phil 8>
It sure looks like the programs just pass the host name string on to the resolver library, which does not understand the significance of the '%' even though it could find and see that the name preceding the '%' is consistent with that being an IPv6 link local address (e.g. the logic could have been "split at first % and see if preceeding name is found as a link local address and accept that if so, or ignore the split otherwise" ... but it isn't). Is there a different syntax for this ... or was it overlooked in the design of programming around IPv6?

I want to be able to address a host by its link local address, while still using a mnemonic instead of having to type the IPv6 address.
Old 05-03-2010, 11:21 AM   #2
Senior Member
Registered: May 2009
Location: WV, USA
Distribution: Slackware, Ubuntu, Amazon Linux
Posts: 1,830
Blog Entries: 21

Original Poster
Rep: Reputation: 119Reputation: 119
I just went ahead and wrote a front end for the ssh command to look up the link local address in /etc/hosts and substitute it along with a default local interface index.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
IPv6 link-local configuration for ethernet interface Skaperen Linux - Networking 0 02-09-2010 02:20 PM
ipsec encryption between 2 servers on an ipv6 local link Dutchy_ Linux - Networking 2 10-15-2009 04:01 PM
Changing hostname in /etc/hosts so that it is defined to ip-address and not loopback Azazwa Linux - Newbie 1 03-09-2009 09:48 AM
IPv6 Link Local Multicast wirelessman Programming 1 11-20-2002 12:32 AM
IPv6 Link Local Multicast wirelessman Linux - Networking 0 11-19-2002 04:55 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:46 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration