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 |
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. |
Quote:
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. |
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:
|
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. |
Quote:
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! |
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. |
All times are GMT -5. The time now is 08:53 PM. |