LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Can DHCP do that? (https://www.linuxquestions.org/questions/linux-networking-3/can-dhcp-do-that-316019/)

ivanatora 04-22-2005 08:09 AM

Can DHCP do that?
 
Just came up in my mind. Can DHCP assign an IP address and network configurations to given host (well, it can :) ) and then change these things to another?
The idea is as follows: gateway A, several hosts connected to it (one of them should be B). When B boots he gets an IP from a private network (192.168.0.X for example) and no access out of the gateway. When a client from B log on into a web page that is hosted on A, the DHCP changes B's IP to a public one and sends him another network configuration (for the gateway, new IP, new subnet mask, etc).
The idea is, can DHCP change network configuration to a host, when already send them while booting? Well... its 'dinamycal' in the name, so I guess it can be done in some way :)

david_ross 04-22-2005 09:31 AM

A dhcp server will only respond to a dhcp request made by a client so you would also have to get the client to ask for another IP address.

If you are looking for a way to authenticate clients then getting your webpage to add an iptables rule would be a lot simpler.

ivanatora 04-23-2005 12:41 PM

I thought about that, but also thought about changing the IP ;)
Thanks for the info. Is there any other method to change an IP of a host other than DHCP?:)

winsnomore 04-23-2005 01:56 PM

you can bring down the interface and then restart the networking with a new address. so you could write a little application that waits on socket and after getting a message kicks of a script that does the stoping and starting.
this whole things sounds rather bizzare, but it can be done.
When you find that you are trying to do something for which no simpler solution exists, you should rethink what you are trying to do, most situations are handled by the protocols and the packages. Generally speaking changing machine name/addresses dynamically is not a good idea.

ivanatora 04-24-2005 03:40 AM

Thanks, I'll think about that :)


All times are GMT -5. The time now is 08:27 PM.