Change dhcp server IP address
Simon Hobson
dhcp1 at thehobsons.co.uk
Mon Feb 19 08:53:49 UTC 2007
Kone Bakenon - wrote:
> > Kone Bakenon - wrote:
>>
>>> > Can you post your config and a description of the network ?
>>
>>>Here you have my dhcpd.conf
>>>subnet 172.16.0.0 netmask 255.255.240.0
>>>{
>>> range 172.16.1.1 172.16.15.254;
>>> option subnet-mask 255.255.240.0;
>>> option routers 172.16.0.1;
>>> option broadcast-address 172.16.15.255;
>>> option domaine-name "mydomain.bf";
>>> option domaine-name-servers 206.82.130.195;
>>> default lease-time 3600;
>>> max-lease-time 7200;
>>>}
>>>
>>>subnet 172.16.16.0 netmask 255.255.240.0
>>>{
>>> range 172.16.16.2 172.16.31.254;
>>> option subnet-mask 255.255.240.0;
>>> option routers 172.16.16.1;
>>> option broadcast-address 172.16.31.255;
>>> option domaine-name "mydomain.bf";
>>> option domaine-name-servers 206.82.130.195;
>>> default lease-time 3600;
>>> max-lease-time 7200;
>>>}
>>
>> That looks fairly normal, but you still haven't described the
>> network, or explained what exactly isn't working.
>>
>>
>
>My network is subnetted in Vlan 3 and Vlan 4. The first time when a
>computer is on Vlan 3 or 4, it takes a good parameters but if the same
>computer is moved to another Vlan, all the parameters changes but only the
>IP address of dhcp server is the same.
>The IP address for dhcp server should be 172.16.0.1 on Vlan 3 and
>172.16.16.1 on Vlan 4.
>From Vlan 3 to Vlan 4, the IP address and the dhcp server address for the
>host computer should change but they don't.
>I think to be clear now.
No - it's still not clear as you have not adequately described your network.
I'm *guessing* that you don't have any routing between the VLANs, so
a client with (say) 172.16.16.123 can't communicate with the DHCP
server at 172.16.0.1.
If that is the case, then your network is broken and you should
really be looking at fixing that.
I'm also *guessing* that the server is connected to both VLANs (is it
the router ?). If so then you can probably work around the problem by
setting the server-identifier option to give out the required server
IP address in each subnet.
From man dhcpd.conf :
The server-identifier statement
server-identifier hostname;
The server-identifier statement can be used to define
the value that is sent in the DHCP Server Identifier
option for a given scope. The value specified must
be an IP address for the DHCP server, and must be
reachable by all clients served by a particular
scope.
The use of the server-identifier statement is not
recommended - the only reason to use it is to force a
value other than the default value to be sent on
occasions where the default value would be incorrect.
The default value is the first IP address associated
with the physical network interface on which the
request arrived.
The usual case where the server-identifier statement
needs to be sent is when a physical interface has
more than one IP address, and the one being sent by
default isn't appropriate for some or all clients
served by that interface. Another common case is
when an alias is defined for the purpose of having a
consistent IP address for the DHCP server, and it is
desired that the clients use this IP address when
contacting the server.
Supplying a value for the dhcp-server-identifier
option is equivalent to using the server-identifier
statement.
More information about the dhcp-users
mailing list