LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to make practical use of link scope IPv6 addresses? (https://www.linuxquestions.org/questions/linux-networking-3/how-to-make-practical-use-of-link-scope-ipv6-addresses-815995/)

Dulcinea 06-23-2010 04:15 PM

How to make practical use of link scope IPv6 addresses?
 
I am trying to use link scope IPv6 addresses to permit two machines to connect using IPv6, but I cannot figure out how to do it without specifying the interface to use on every connection. Here is an example ping:
[root@ppatel-brn1 ~]# ping6 -c 3 fe80::204:75ff:feb6:2994
connect: Invalid argument
[root@ppatel-brn1 ~]# ping6 -c 3 -I eth0 fe80::204:75ff:feb6:2994
PING fe80::204:75ff:feb6:2994(fe80::204:75ff:feb6:2994) from fe80::214:22ff:febd:7c1f eth0: 56 data bytes
64 bytes from fe80::204:75ff:feb6:2994: icmp_seq=0 ttl=64 time=0.836 ms
64 bytes from fe80::204:75ff:feb6:2994: icmp_seq=1 ttl=64 time=0.286 ms
64 bytes from fe80::204:75ff:feb6:2994: icmp_seq=2 ttl=64 time=0.280 ms

--- fe80::204:75ff:feb6:2994 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2000ms
rtt min/avg/max/mdev = 0.280/0.467/0.836/0.261 ms, pipe 2
It makes sense to me that the OS doesn't know that fe80::204:75ff:feb6:2994 is out eth0 because I have two interfaces, but if I add a route, I get the same thing:
[root@ppatel-brn1 ~]# ip -6 route add fe80::204:75ff:feb6:2994 dev eth0
[root@ppatel-brn1 ~]# ping6 -c 3 fe80::204:75ff:feb6:2994
connect: Invalid argument
I have seen network traces of Windows-based machines happily transmitting to and from link scope addresses, but it seems I cannot do this in Linux. What am I doing wrong?

TimothyEBaldwin 06-24-2010 08:17 AM

You MUST supply the interface, this can be done by appending it to the address like "fe80::204:75ff:feb6:2994%eth0". This is supported by most programs.

Or you can use multicast DNS to resolve the name.

Dulcinea 06-24-2010 09:09 AM

Thanks!

Dulcinea 06-24-2010 09:47 AM

scp with IPv6 link scope address
 
I tried the suggestion of appending %<interface> to an IPv6 address to use the link scope address, and that worked for ssh but not scp. I found a partial solution over at another web site (http://marc.info/?l=openssh-unix-dev&m=112975365929888), and here's the extension of it to link scope addressing:

Assuming that host fe80::204:75ff is reachable via eth0 and I want to copy foo.pdf from joe's home directory over there to my local working directory, I would use this syntax:
scp 'joe@[fe80::204:75ff%eth0]':foo.pdf .


All times are GMT -5. The time now is 09:53 PM.