MAC address of an IPv6 address

MAC address of an IPv6 address

Post by Jigs » Thu, 12 Apr 2007 05:34:32



Hi All,

I am writing a program that tests the health of a NIC card. I am
creating a NDD socket (Data Link Access) which I will use to send ICMP
ECHO packets to a given host. This means that my application has to
build the entire packet and I have to create and add the IP/IPv6,
ICMP/
6, and MAC headers in my application. I got things to work for IP, but
I am stuck with IPv6:

1) How do I find the MAC address for an IPv6 remote host? For IP, I
use the SIOCGARP ioctl and get the MAC adress from the ARP cache. But
IPv6 does not use ARP. there is something called neighbor discovery
for IPv6, but I could not find any programatic interface to use it ..

2) How do I do a broadcast ping in IPv6? In v4, I just put the
broadcast address in the destination addr fiend of the IP header and
things worked, but what do I do for v6?

Thanks in advance for your help.

Jigs

 
 
 

MAC address of an IPv6 address

Post by SadOldGi » Thu, 12 Apr 2007 09:06:06



> Hi All,
> [snip]
ping6 ?

> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
> broadcast address in the destination addr fiend of the IP header and
> things worked, but what do I do for v6?

MAC address is part of the IPv6 address - no more ARP!

Quote:

> Thanks in advance for your help.

> Jigs

Steve

 
 
 

MAC address of an IPv6 address

Post by Hans » Thu, 12 Apr 2007 23:20:06




>> Hi All,
>> [snip]
> ping6 ?
>> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
>> broadcast address in the destination addr fiend of the IP header and
>> things worked, but what do I do for v6?

> MAC address is part of the IPv6 address - no more ARP!

When jou set the ip address manually it is not.

--
Hans

 
 
 

MAC address of an IPv6 address

Post by SadOldGi » Fri, 13 Apr 2007 07:42:30





>>> Hi All,
>>> [snip]
>> ping6 ?
>>> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
>>> broadcast address in the destination addr fiend of the IP header and
>>> things worked, but what do I do for v6?

>> MAC address is part of the IPv6 address - no more ARP!

> When jou set the ip address manually it is not.

"When IEEE 802 48bit MAC addresses are available (on an interface or a
   node), an implementation should use them to create interface
   identifiers due to their availability and uniqueness properties."
RFC2373

OK, it doesn't say must!

 
 
 

MAC address of an IPv6 address

Post by Hans » Sat, 14 Apr 2007 05:59:23






>>>> Hi All,
>>>> [snip]
>>> ping6 ?
>>>> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
>>>> broadcast address in the destination addr fiend of the IP header and
>>>> things worked, but what do I do for v6?
>>> MAC address is part of the IPv6 address - no more ARP!
>> When jou set the ip address manually it is not.

> "When IEEE 802 48bit MAC addresses are available (on an interface or a
>    node), an implementation should use them to create interface
>    identifiers due to their availability and uniqueness properties."
> RFC2373

> OK, it doesn't say must!

Should is almost must. By the way:

bash-3.1# ip addr -6 show dev eth0
2: eth0: <BROADCAST,MULTICAST,NOTRAILERS,UP,10000> mtu 1500 qdisc
pfifo_fast qlen 1000
     link/ether 00:11:43:61:8d:db brd ff:ff:ff:ff:ff:ff
     inet6 2001:888:1639::4/48 scope global
        valid_lft forever preferred_lft forever
     inet6 fe80::211:43ff:fe61:8ddb/64 scope link
        valid_lft forever preferred_lft forever
bash-3.1#

The global scope is mac-free, but the scope link is not. And on another
pc of mine every bridge-port (except eth3) seems to have its own ip6
addr whether i like it or not:

bash-3.1# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.003018a54f01       no              eth0
                                                         eth1
                                                         eth2
                                                         eth3
bash-3.1# ip -6 addr show
1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
     inet6 fe80::230:18ff:fea5:ebfd/64 scope link
        valid_lft forever preferred_lft forever
2: lo: <LOOPBACK,UP,10000> mtu 16436
     inet6 ::1/128 scope host
        valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
     inet6 fe80::230:18ff:fea5:4f01/64 scope link
        valid_lft forever preferred_lft forever
4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qlen 1000
     inet6 fe80::230:18ff:fea5:4f02/64 scope link
        valid_lft forever preferred_lft forever
7: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500
     inet6 2001:888:1639::2/48 scope global
        valid_lft forever preferred_lft forever
     inet6 fe80::230:18ff:fea5:4f01/64 scope link
        valid_lft forever preferred_lft forever

--
Hans

 
 
 

MAC address of an IPv6 address

Post by SadOldGi » Sat, 14 Apr 2007 09:00:35







>>>>> Hi All,
>>>>> [snip]
>>>> ping6 ?
>>>>> 2) How do I do a broadcast ping in IPv6? In v4, I just put the
>>>>> broadcast address in the destination addr fiend of the IP header and
>>>>> things worked, but what do I do for v6?
>>>> MAC address is part of the IPv6 address - no more ARP!
>>> When jou set the ip address manually it is not.

>> "When IEEE 802 48bit MAC addresses are available (on an interface or a
>>    node), an implementation should use them to create interface
>>    identifiers due to their availability and uniqueness properties."
>> RFC2373

>> OK, it doesn't say must!

> Should is almost must. By the way:

> bash-3.1# ip addr -6 show dev eth0
> 2: eth0: <BROADCAST,MULTICAST,NOTRAILERS,UP,10000> mtu 1500 qdisc
> pfifo_fast qlen 1000
>     link/ether 00:11:43:61:8d:db brd ff:ff:ff:ff:ff:ff
>     inet6 2001:888:1639::4/48 scope global
>        valid_lft forever preferred_lft forever
>     inet6 fe80::211:43ff:fe61:8ddb/64 scope link
>        valid_lft forever preferred_lft forever
> bash-3.1#

> The global scope is mac-free, but the scope link is not. And on another
> pc of mine every bridge-port (except eth3) seems to have its own ip6
> addr whether i like it or not:

> bash-3.1# brctl show
> bridge name     bridge id               STP enabled     interfaces
> br0             8000.003018a54f01       no              eth0
>                                                         eth1
>                                                         eth2
>                                                         eth3
> bash-3.1# ip -6 addr show
> 1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
>     inet6 fe80::230:18ff:fea5:ebfd/64 scope link
>        valid_lft forever preferred_lft forever
> 2: lo: <LOOPBACK,UP,10000> mtu 16436
>     inet6 ::1/128 scope host
>        valid_lft forever preferred_lft forever
> 3: eth1: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qlen 1000
>     inet6 fe80::230:18ff:fea5:4f01/64 scope link
>        valid_lft forever preferred_lft forever
> 4: eth2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qlen 1000
>     inet6 fe80::230:18ff:fea5:4f02/64 scope link
>        valid_lft forever preferred_lft forever
> 7: br0: <BROADCAST,MULTICAST,UP,10000> mtu 1500
>     inet6 2001:888:1639::2/48 scope global
>        valid_lft forever preferred_lft forever
>     inet6 fe80::230:18ff:fea5:4f01/64 scope link
>        valid_lft forever preferred_lft forever

Thanks Hans - I must check that out on mine :)
 
 
 

1. Command for assigning IPv6 address and MAC address on the interface

Hello,

iceman a crit :

man ifconfig
man 8 ip

Please can you elaborate ? How do you see it does not work ?

Yes, it works for me. You can also assign an IPv6 address with the 'ip'
command from the iproute/iproute2 package :

ip -6 address add 2001:0db8:0:f101::1/64 dev eth0

Note that the 2001:0db8::/32 range is to be used for documentation
purpose only. If you do not have a global prefix you can create and use
a prefix in the unique local address range (ULA, cf. RFC 4193). A
generator is available at <http://www.kame.net/~suz/gen-ula.html>.

2. XWin32 screen size.

3. How to map IPv6-address to IPv4-address with Linux

4. Connecting to own IP address when net is down

5. Binding a single IP Address to two different MAC addresses

6. 3c509 & AHA1542 & SCSI-2 DAT - try this...

7. Is different 'Ethenet address' from 'Mac Address' ?

8. Help : Man O Man

9. Determining IP address from MAC address

10. MAC Address From IP Address

11. change MAC address can change IP address of a machine?

12. using mac address instead of an IP address of hostname

13. how to convert mac address to ip address