From owner-freebsd-questions@FreeBSD.ORG Thu Oct 14 08:10:50 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F30A16A4CE for ; Thu, 14 Oct 2004 08:10:50 +0000 (GMT) Received: from pluton.ispras.ru (pluton.ispras.ru [83.149.199.253]) by mx1.FreeBSD.org (Postfix) with SMTP id DD0E543D45 for ; Thu, 14 Oct 2004 08:10:48 +0000 (GMT) (envelope-from grn@ispras.ru) Received: (qmail 62515 invoked from network); 14 Oct 2004 08:12:50 -0000 Received: from unknown (HELO truba.ispras.ru) (83.149.198.41) by pluton.ispras.ru with SMTP; 14 Oct 2004 08:12:50 -0000 Received: from truba.ispras.ru (root@localhost) by truba.ispras.ru (8.13.1/8.13.1) with SMTP id i9E7whDX024542 for ; Thu, 14 Oct 2004 11:58:43 +0400 Received: from ispras.ru (pila.ispras.ru [83.149.198.208]) by truba.ispras.ru (8.13.1/8.13.1) with ESMTP id i9E7whhF024535 for ; Thu, 14 Oct 2004 11:58:43 +0400 Message-ID: <416E34C8.6040807@ispras.ru> Date: Thu, 14 Oct 2004 12:11:52 +0400 From: Grigory Klyuchnikov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-SpamTest-Info: Profile: Formal (125/041012) X-SpamTest-Info: Profile: Detect Standard No RBL (4/030526) X-SpamTest-Info: Profile: SysLog X-SpamTest-Info: Profile: Marking Spam - Subject (2/030321) X-SpamTest-Status: Not detected X-SpamTest-Version: SMTP-Filter Version 2.0.0 [0125], KAS/Release SMTP-Filter Version 2.0.0 [0125], KAS/Release Subject: Set IPv6 address on the interface X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Oct 2004 08:10:50 -0000 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.