Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-27-2010, 02:19 AM
|
#1
|
|
LQ Newbie
Registered: Dec 2008
Location: Finland
Distribution: Ubuntu, OpenWrt
Posts: 5
Rep:
|
Answering to a single DHCP request from command line (for temp device configuration)?
I'm often configuring different devices. For that I have two Ethernet interfaces in my Ubuntu pc. Eth0 interface uses dhcp to receive IP for public network, and eth1 interface is configured manually to match network settings of the device to be configured.
However some of devices which I have to configure are requesting address by dhcp. Is there way to not run dhcp server for them, but just issue single IP temporarily for the configuration process. And of course it should not mess up my normal routing table.
Ideally I'm looking something like
./give_ip 10.1.1.17 -i eth1
Probably some dhcp servers programs could do this, but mayby I have not found the correct search terms yet.
All the help is appreciated. Thanks, Jo2
|
|
|
|
10-27-2010, 02:40 AM
|
#2
|
|
Guru
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 5,301
|
The dhcp interchange is quite complicated.
If you use a dhcp server you can assign IPs to the boxes that log in. Way to go. The dhcp process is not trivial.
|
|
|
|
10-27-2010, 02:55 AM
|
#3
|
|
LQ Newbie
Registered: Dec 2008
Location: Finland
Distribution: Ubuntu, OpenWrt
Posts: 5
Original Poster
Rep:
|
Quote:
Originally Posted by business_kid
The dhcp interchange is quite complicated.
If you use a dhcp server you can assign IPs to the boxes that log in. Way to go. The dhcp process is not trivial.
|
Thank you for suggestion. I have used dhcp server for that, but I do not want to run dhcp server by default as it can interfere with other things. One thing is that the interface gets it's IP range changed quite often.
Solution could be any dhcp server software, which can be instructed to issue single IP address to selected interface. I assume that one of the servers must have sufficient command line options and I just have not found it yet.
|
|
|
|
10-27-2010, 03:23 AM
|
#4
|
|
Senior Member
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,096
Rep: 
|
HI,
If you have DHCP Linux server then try to bind the MAC address of a particular system to a fixed IP like given below:
Quote:
host ns2 {
next-server ns2.your-domain.com;
hardware ethernet 00:02:c3:d0:e5:83;
fixed-address 192.168.10.100;
}
|
|
|
|
|
10-27-2010, 03:55 AM
|
#5
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Even a cable/dns router allows you to assign fixed IP addresses to certain hosts based on their MAC address. I do this at home, using a Linksys wireless router. This enables me to maintain a constant /etc/hosts file.
You can configure your first interface to use DHCP and the second manually. The Ubuntu host won't request an address from DHCP if you don't configure it to.
Also, most routers have a range where they assign addresses. By default a Linksys router will start at at .100 for the last octet. Assign your manual IPs from .2 to .99 and you won't have any conflicts.
Last edited by jschiwal; 10-27-2010 at 04:00 AM.
|
|
|
|
10-27-2010, 06:47 AM
|
#6
|
|
LQ Newbie
Registered: Dec 2008
Location: Finland
Distribution: Ubuntu, OpenWrt
Posts: 5
Original Poster
Rep:
|
Quote:
Originally Posted by prayag_pjs
HI,
If you have DHCP Linux server then try to bind the MAC address of a particular system to a fixed IP like given below:
|
This requires me to edit configuration file for each client device and restart the service. Point is that I have a large number of devices that I have randomly play around. Devices are connected one by one directly to eth1, so from my point of view simply approach would be to give selected ip to next client requesting one.
Entering data to configuration file is something that I can do, but I was wishing that I control everything directly from a command line tool.
Thank you for your input!
|
|
|
|
10-27-2010, 06:54 AM
|
#7
|
|
Senior Member
Registered: Feb 2008
Location: Pune - India
Distribution: Fedora,RedHat,CentOS,Gentoo
Posts: 1,096
Rep: 
|
Hi,
Generally DHCP server is only one in single network.So you have to edit only server.I don't get the exact problem you are facing.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:27 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|