Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Oct 2004 12:11:52 +0400
From:      Grigory Klyuchnikov <grn@ispras.ru>
To:        freebsd-questions@freebsd.org
Subject:   Set IPv6 address on the interface
Message-ID:  <416E34C8.6040807@ispras.ru>

next in thread | raw e-mail | index | archive | help
Hello,

I'd like to set an IPv6 address to the ethernet interface from a user 
process,
but I don't understand which system call may be used. For getting 
information
about interfaces and addresses there are some methods: ioctl (with 
SIOCGIFCONF),
sysctl (witch NET_RT_IFLIST), AF_ROUTE socket, getifaddrs(). I've tried 
ioctl()
and sysctl() for this purpose. For setting an IPv4 addreess to the 
interface there is
ioctl() with  SIOCSIFADDR. How set an IPv6 address? There is SIOCSIFADDR_IN6
for setting address, but it doesen't work as say the comment in in6.c. 
And there are two
commands  SIOCDIFADDR_IN6 and SIOCAIFADDR_IN6, delete/add address
accordingly, but I've got error: Invalid argument. Or I don't know how 
use them.

My questions:
1) How can I set an IPv6 on the ethernet interface?
2) How can I get IPv6 multicast addresses from each interface?

If anyone knows something about, please, give me an answer or reference 
to it.

Best regards,
Grigory Klyuchnikov.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?416E34C8.6040807>