Visit the LQ Articles and Editorials section
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-15-2003, 07:50 AM   #1
Registered: Mar 2003
Location: Kurnool, India.
Distribution: Redhat 9
Posts: 67

Rep: Reputation: 15
Multiple addresses for a single NIC

I am having one network card, which is aliased for 4 different ip addresses.
How can I get the details of all the ip addressess using my C program.

Presently for eth0 if I do a ioctl, it returns one ipaddress. How to get the details about other ip address.

Old 08-04-2003, 02:24 AM   #2
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
try using ioctl with SIOCGICONF....flag and get the information of the interface in the structure ..struct ifreq ..

open a socket and pass the fd to ioctl...with the aformentioned flag ..should work

Last edited by shishir; 08-04-2003 at 02:45 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
multiple ip addresses on 1 nic? houler Linux - Networking 4 04-26-2005 03:53 PM
setting muliple IP addresses on Single NIC cranium2004 Linux - Networking 1 02-08-2005 05:55 AM
Bind Multi IP addresses to a single NIC sitg Linux - Networking 2 04-30-2004 08:59 PM
how do i group multiple global ip addresses on a single network iterface? shinacalypse Linux - Networking 3 09-08-2003 06:07 AM
Multiple IP addresses on one NIC hrr Linux - Networking 2 03-07-2003 12:04 PM

All times are GMT -5. The time now is 12:34 AM.

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