LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-09-2011, 09:09 PM   #1
nikole
LQ Newbie
 
Registered: Apr 2010
Posts: 13

Rep: Reputation: 0
unable to set ipv6 interface name using ioctl


i am trying to create a virtual ip on eth0. but the new interface created is with same name as eth0, instead of eth0:1.

i tried something like this

socv6=socket(AF_INET6, SOCK_DGRAM, 0);

strcpy(ifr.ifr_name,"eth0:1");

ioctl(socv6, SIOGIFINDEX, &ifr);

ifr6.ifr6_ifindex = ifr.ifr_ifindex;

ifr6.ifr6_prefixlen = 64;

ipv6add= (struct in6_addr *)&ifr.ifr_addr;

inet_pton(AF_INET6, "fe80::19", &ifr6.ifr6_addr);

ioctl(socv6,SIOCSIFADDR,&ifr6);
 
Old 11-10-2011, 07:16 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply



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
how to get IPv6 address using ioctl() SIOCGIFADDR ashok449 Linux - Networking 6 01-03-2012 11:39 PM
assign ipv6 address using ioctl manishtiwari_1987 Linux - Newbie 1 07-23-2011 05:41 PM
Unable to get IPv6 addresses using ioctl() rachitraj Linux - Networking 1 02-23-2011 07:24 AM
unable to set ipv6 address to aliased interface adevendra Linux - Networking 0 11-04-2010 10:53 AM
Cannot create an IPv6 virtual IP (alias interface) using ioctl(SIOCSIFADDR) the_rock Linux - Newbie 2 08-20-2010 04:14 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:46 PM.

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