Networking Forums

Networking Forums > Computer Networking > Linux Networking > Does anybody know if there is an API to configure the ip address of an interface?

Reply
Thread Tools Display Modes

Does anybody know if there is an API to configure the ip address of an interface?

 
 
bighead_csu@hotmail.com
Guest
Posts: n/a

 
      05-24-2006, 12:22 PM
I got the linux kernel source, but can't find a function to set ip
address. Who can give me a hand, thanks!

 
Reply With Quote
 
 
 
 
Claude R Trepanier
Guest
Posts: n/a

 
      05-24-2006, 12:49 PM
(E-Mail Removed) wrote:
> I got the linux kernel source, but can't find a function to set ip
> address. Who can give me a hand, thanks!
>

Any reason you don't want to use ifconfig?

crt
 
Reply With Quote
 
Davide Bianchi
Guest
Posts: n/a

 
      05-24-2006, 12:52 PM
On 2006-05-24, (E-Mail Removed) <(E-Mail Removed)> wrote:
> I got the linux kernel source, but can't find a function to set ip
> address. Who can give me a hand, thanks!


Why don't you look at the source code of ifconfig ?
Davide

--
Microsoft should abandon the funny looking Windows logo and just hoist the
Jolly Roger.
 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a

 
      05-24-2006, 01:52 PM
(E-Mail Removed) wrote:
> I got the linux kernel source, but can't find a function to set ip
> address. Who can give me a hand, thanks!


There are ioctl() calls to do that, but if you need to ask,
you probably should not attempt to do it.

--

Tauno Voipio
tauno voipio (at) iki fi

 
Reply With Quote
 
alchemist
Guest
Posts: n/a

 
      05-26-2006, 09:06 AM
Check out the ioctls() - SIOCSIFADDR, SIOCSIFNETMASK and
SIOCSIFBRDADDR. Also you might need a sequence in which these ioctls
needs to be executed. You will need root permissions to execute these
ioctls.

Another quick way to find which systems calls are made is via using
'strace' on 'ifconfig eth* <IP> <netmask> <bcast'.

-Shailesh.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command for assigning IPv6 address and MAC address on the interface iceman Linux Networking 7 03-03-2008 07:51 PM
Forcing a particular IP address out to an interface nick4soup@yahoo.com.au Linux Networking 4 10-12-2005 10:44 PM
Change MAC address without down interface macd55 Linux Networking 0 10-11-2004 10:08 PM
How configure router to block access to IP address Walter Cohen Wireless Internet 1 06-08-2004 08:29 AM
Configure a Permanent IP Address for Network Devices tg Windows Networking 0 02-24-2004 08:32 PM



1 2 3 4 5 6 7 8 9 10 11