Strange configuration problem

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange configuration problem

Petar Kozić
Hi,
I have a strange problem with isc-dhcp-server 4.0 on Ubuntu 18.04. I tried everything, read documentation, forums, etc.. but I can't solve problem.

I have server with two vlan interface which is connected on vswitch. Both interfaces have set of public IP addresses.
All that is ok and address is reachable and works.

My interfaces name is vmbr0 and vmbr0:2
Both interface I have set in /etc/default/isc-dhcp-server

INTERFACESv4="vmbr0 vmbr0:2"

In dhcpd.conf I have:


#
# Global options
#

authoritative;
log-facility local7;
default-lease-time 3600;
max-lease-time 7200;

#
# Subnet declarations
#
subnet 116.199.70.96 netmask 255.255.255.240 {
default-lease-time 3600;
option routers 116.199.70.97;
option interface-mtu 1400;
option subnet-mask 255.255.255.240;
option broadcast-address 116.199.70.111;
option domain-name-servers 8.8.8.8, 8.8.4.4;
range 116.199.70.98 116.199.70.110;
}

subnet 116.199.68.208 netmask 255.255.255.240 {
default-lease-time 3600;
option routers 116.199.68.209;
option interface-mtu 1400;
option subnet-mask 255.255.255.240;
option broadcast-address 116.199.68.223;
option domain-name-servers 8.8.8.8, 8.8.4.4;
range 116.199.68.210 116.199.68.222;
}

## IP reservation from first subnet ##

host myhost1 {
hardware ethernet FE:4A:DB:C0:BF:AD;
fixed-address 116.199.70.98;
}
host myhost2 {
hardware ethernet AA:6D:47:76:58:58;
fixed-address 116.199.70.99;
}
host myhost3 {
hardware ethernet 86:CB:59:8B:CD:BA;
fixed-address 116.199.70.100;
}
host myhost4 {
hardware ethernet D6:9R:79:44:93:AD;
fixed-address 116.199.70.101;
}
host myhost5 {
hardware ethernet 06:BW:15:DD:09:79;
fixed-address 116.199.70.102;
}

## IP reservation from second subnet ##

host myhost6 {
hardware ethernet A6:88:27:56:E8:3A;
fixed-address 116.199.68.210;
}
host myhost7 {
hardware ethernet 82:62:6C:7B:AB:74;
fixed-address 116.199.68.211;
}
host myhost8 {
hardware ethernet CA:A1:7C:C3:D4:B3;
fixed-address 116.199.68.217;
}
host myhost9 {
hardware ethernet F1:A6:7B:25:57:F4;
fixed-address 116.199.68.219;
}
host myhost10 {
hardware ethernet BE:87:BF:DB:F4:9E;
fixed-address 116.199.68.218;
}


My problem is in that because the client in IP reservation sometimes gets reserved IP sometimes first free IP from range which isn't in the reservation list.
I can't figure how to set this config to permanent stay on the same IP.

For example if myhost1 gets the right IP and that VM works about 10 days and I need to reboot for some reason after reboot get another IP, that is weird.
Or on an example I have baremetal server where I have virtualization and there is my VM from myhost1 to myhost8, if I reboot baremetal after booting, two VM get right IP, other not.

What wrong am I doing?
Thank you.



Petar Kozić


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Strange configuration problem

Sten Carlsen


On 14-01-2020 16.38, Petar Kozić wrote:

#
# Subnet declarations
#
subnet 116.199.70.96 netmask 255.255.255.240 {
default-lease-time 3600;
option routers 116.199.70.97;
option interface-mtu 1400;
option subnet-mask 255.255.255.240;
option broadcast-address 116.199.70.111;
option domain-name-servers 8.8.8.8, 8.8.4.4;
range 116.199.70.98 116.199.70.110;
}


## IP reservation from first subnet ##

host myhost1 {
hardware ethernet FE:4A:DB:C0:BF:AD;
fixed-address 116.199.70.98;
}
host myhost2 {
hardware ethernet AA:6D:47:76:58:58;
fixed-address 116.199.70.99;
}
host myhost3 {
hardware ethernet 86:CB:59:8B:CD:BA;
fixed-address 116.199.70.100;
}
host myhost4 {
hardware ethernet D6:9R:79:44:93:AD;
fixed-address 116.199.70.101;
}
host myhost5 {
hardware ethernet 06:BW:15:DD:09:79;
fixed-address 116.199.70.102;
}

These host statements have a fixed address that is in the range, that means that the server will hand these addresses out to any other device that asks for an address.

Host statements with fixed addresses should normally have addresses outside any range, then the server will not be able to hand these addresses out to other devices.


My problem is in that because the client in IP reservation sometimes gets reserved IP sometimes first free IP from range which isn't in the reservation list.
I can't figure how to set this config to permanent stay on the same IP.

For example if myhost1 gets the right IP and that VM works about 10 days and I need to reboot for some reason after reboot get another IP, that is weird.
Or on an example I have baremetal server where I have virtualization and there is my VM from myhost1 to myhost8, if I reboot baremetal after booting, two VM get right IP, other not.

What wrong am I doing?
Thank you.



Petar Kozić


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
-- 
Best regards

Sten Carlsen

No improvements come from shouting:

"MALE BOVINE MANURE!!!" 

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Strange configuration problem

Petar Kozić
Thank you very much, I will try that.

On Tue, Jan 14, 2020, 18:50 Sten Carlsen <[hidden email]> wrote:


On 14-01-2020 16.38, Petar Kozić wrote:

#
# Subnet declarations
#
subnet 116.199.70.96 netmask 255.255.255.240 {
default-lease-time 3600;
option routers 116.199.70.97;
option interface-mtu 1400;
option subnet-mask 255.255.255.240;
option broadcast-address 116.199.70.111;
option domain-name-servers 8.8.8.8, 8.8.4.4;
range 116.199.70.98 116.199.70.110;
}


## IP reservation from first subnet ##

host myhost1 {
hardware ethernet FE:4A:DB:C0:BF:AD;
fixed-address 116.199.70.98;
}
host myhost2 {
hardware ethernet AA:6D:47:76:58:58;
fixed-address 116.199.70.99;
}
host myhost3 {
hardware ethernet 86:CB:59:8B:CD:BA;
fixed-address 116.199.70.100;
}
host myhost4 {
hardware ethernet D6:9R:79:44:93:AD;
fixed-address 116.199.70.101;
}
host myhost5 {
hardware ethernet 06:BW:15:DD:09:79;
fixed-address 116.199.70.102;
}

These host statements have a fixed address that is in the range, that means that the server will hand these addresses out to any other device that asks for an address.

Host statements with fixed addresses should normally have addresses outside any range, then the server will not be able to hand these addresses out to other devices.


My problem is in that because the client in IP reservation sometimes gets reserved IP sometimes first free IP from range which isn't in the reservation list.
I can't figure how to set this config to permanent stay on the same IP.

For example if myhost1 gets the right IP and that VM works about 10 days and I need to reboot for some reason after reboot get another IP, that is weird.
Or on an example I have baremetal server where I have virtualization and there is my VM from myhost1 to myhost8, if I reboot baremetal after booting, two VM get right IP, other not.

What wrong am I doing?
Thank you.



Petar Kozić


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
-- 
Best regards

Sten Carlsen

No improvements come from shouting:

"MALE BOVINE MANURE!!!" 
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Strange configuration problem

Petar Kozić

I tried this, but if I remove range from config, my virtual host can’t get IP during boot.

When virtual machine boot and I log onto it I can see there is no IP address assign. If I run dhclient command in virtua machine IP assigned.

Really strange problems with this dhcp server.



Thank you very much, I will try that.

On Tue, Jan 14, 2020, 18:50 Sten Carlsen <[hidden email]> wrote:


On 14-01-2020 16.38, Petar Kozić wrote:

#
# Subnet declarations
#
subnet 116.199.70.96 netmask 255.255.255.240 {
default-lease-time 3600;
option routers 116.199.70.97;
option interface-mtu 1400;
option subnet-mask 255.255.255.240;
option broadcast-address 116.199.70.111;
option domain-name-servers 8.8.8.8, 8.8.4.4;
range 116.199.70.98 116.199.70.110;
}


## IP reservation from first subnet ##

host myhost1 {
hardware ethernet FE:4A:DB:C0:BF:AD;
fixed-address 116.199.70.98;
}
host myhost2 {
hardware ethernet AA:6D:47:76:58:58;
fixed-address 116.199.70.99;
}
host myhost3 {
hardware ethernet 86:CB:59:8B:CD:BA;
fixed-address 116.199.70.100;
}
host myhost4 {
hardware ethernet D6:9R:79:44:93:AD;
fixed-address 116.199.70.101;
}
host myhost5 {
hardware ethernet 06:BW:15:DD:09:79;
fixed-address 116.199.70.102;
}

These host statements have a fixed address that is in the range, that means that the server will hand these addresses out to any other device that asks for an address.

Host statements with fixed addresses should normally have addresses outside any range, then the server will not be able to hand these addresses out to other devices.


My problem is in that because the client in IP reservation sometimes gets reserved IP sometimes first free IP from range which isn't in the reservation list.
I can't figure how to set this config to permanent stay on the same IP.

For example if myhost1 gets the right IP and that VM works about 10 days and I need to reboot for some reason after reboot get another IP, that is weird.
Or on an example I have baremetal server where I have virtualization and there is my VM from myhost1 to myhost8, if I reboot baremetal after booting, two VM get right IP, other not.

What wrong am I doing?
Thank you.



Petar Kozić


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
--  
Best regards

Sten Carlsen

No improvements come from shouting:

"MALE BOVINE MANURE!!!" 
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Strange configuration problem

Sten Carlsen


On 15-01-2020 09.30, Petar Kozić wrote:

I tried this, but if I remove range from config, my virtual host can’t get IP during boot.

The point is not to remove the range but to set the fixed addresses outside the range. Addresses in the range will be handed out as you describe, the server will not see those as reserved but as available for use.

...

range 116.199.70.98 116.199.70.110;

...

host myhost1 {
hardware ethernet FE:4A:DB:C0:BF:AD;
fixed-address 116.199.70.111;
}

...

There is another method, leases can be marked as reserved for a specific host. This is done in a different way, using Omapi. Check the man page.



When virtual machine boot and I log onto it I can see there is no IP address assign. If I run dhclient command in virtua machine IP assigned.

Really strange problems with this dhcp server.



Thank you very much, I will try that.

On Tue, Jan 14, 2020, 18:50 Sten Carlsen <[hidden email]> wrote:


On 14-01-2020 16.38, Petar Kozić wrote:

#
# Subnet declarations
#
subnet 116.199.70.96 netmask 255.255.255.240 {
default-lease-time 3600;
option routers 116.199.70.97;
option interface-mtu 1400;
option subnet-mask 255.255.255.240;
option broadcast-address 116.199.70.111;
option domain-name-servers 8.8.8.8, 8.8.4.4;
range 116.199.70.98 116.199.70.110;
}


## IP reservation from first subnet ##

host myhost1 {
hardware ethernet FE:4A:DB:C0:BF:AD;
fixed-address 116.199.70.98;
}
host myhost2 {
hardware ethernet AA:6D:47:76:58:58;
fixed-address 116.199.70.99;
}
host myhost3 {
hardware ethernet 86:CB:59:8B:CD:BA;
fixed-address 116.199.70.100;
}
host myhost4 {
hardware ethernet D6:9R:79:44:93:AD;
fixed-address 116.199.70.101;
}
host myhost5 {
hardware ethernet 06:BW:15:DD:09:79;
fixed-address 116.199.70.102;
}

These host statements have a fixed address that is in the range, that means that the server will hand these addresses out to any other device that asks for an address.

Host statements with fixed addresses should normally have addresses outside any range, then the server will not be able to hand these addresses out to other devices.


My problem is in that because the client in IP reservation sometimes gets reserved IP sometimes first free IP from range which isn't in the reservation list.
I can't figure how to set this config to permanent stay on the same IP.

For example if myhost1 gets the right IP and that VM works about 10 days and I need to reboot for some reason after reboot get another IP, that is weird.
Or on an example I have baremetal server where I have virtualization and there is my VM from myhost1 to myhost8, if I reboot baremetal after booting, two VM get right IP, other not.

What wrong am I doing?
Thank you.



Petar Kozić


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
--  
Best regards

Sten Carlsen

No improvements come from shouting:

"MALE BOVINE MANURE!!!" 
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
-- 
Best regards

Sten Carlsen

No improvements come from shouting:

"MALE BOVINE MANURE!!!" 

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Strange configuration problem

Petar Kozić
In reply to this post by Petar Kozić
Thank you. I solved problem with pools and known-clients directive.



Petar Kozić

On January 15, 2020 at 4:23:13 PM, Bruce Hudson ([hidden email]) wrote:

On Wed, Jan 15, 2020 at 09:30:07AM +0100, Petar Kozić wrote:

> I tried this, but if I remove range from config, my virtual host can’t get
> IP during boot.
>
> When virtual machine boot and I log onto it I can see there is no IP
> address assign. If I run dhclient command in virtua machine IP assigned.
>
> Really strange problems with this dhcp server.

You have not included any logs so it is difficult to say what the server
is doing. Overlapping dynamic IP ranges with static assignments is generally
a bad idea but I cannot see it causing the symptoms you described.

It is possible that your clients are, at least under some circumstances,
including a client identifier in their requests. That will over-ride the MAC
address and cause it to get a dynamic assignment (assuming one is available
of course). The logs should tell you if that is the case.

The other issue I noticed is that some of your ethernet addresses
are not in fact valid hexadecimal.

myhost4 == D6:9R...
myhost5 == 06:BW...

That may just be a submission error.
--
Bruce A. Hudson | [hidden email]
ITS, Networks and Systems |
Dalhousie University |
Halifax, Nova Scotia, Canada | (902) 494-3405

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users