LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-23-2010, 12:44 AM   #1
pcube
LQ Newbie
 
Registered: Sep 2009
Posts: 9

Rep: Reputation: 0
How to enable DHCP programatically.


Hi,
I am doing a project on which i need to switch between dhcp and manual network configuration. I want to know how can i set dhcp programatically. I will not be able to edit any config files as my file system is readonly. i am looking for some APIs which could do the task.

Thanks in advance.
 
Old 03-23-2010, 02:16 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
if you can't change any config files, then you can't change it. just run dhclient, or whichever dhcp client you use as and when you want a dhcp address, and manually set it with ifconfig when you want that.
 
Old 03-23-2010, 04:36 AM   #3
pcube
LQ Newbie
 
Registered: Sep 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Hi , thanks for the reply. In the progam, I am using ioctl calls to cofigure newtork in manual mode. I want to know if ioctls or library calls exists which can be used to switch between dhcp and manual mode...
OR Can any one tell me how gui based network configuration tools work?.( i dont think the will internally run a script for ifconfig)
 
  


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 enable DHCP zakkamelizabeth Linux - Networking 2 04-18-2007 06:04 AM
LDAP authenticate with DHCP enable router lnthai2002 Linux - Networking 2 08-31-2006 08:17 PM
enable dhcp for client linuxtesting2 Solaris / OpenSolaris 2 06-08-2006 01:10 AM
Background a process (programatically) podollb Linux - Software 1 11-03-2005 06:28 AM
enable eth1 and dhcp on start up dag33k Linux - Networking 5 03-05-2004 04:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:13 AM.

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