LINUX.ORG.RU
ФорумAdmin

ISC DHCP постепенное (последовательное) использованеи адерсов из 2х и более пулов


0

2

Есть DHCP сервер, где прописаны 2 пула адресов (пока). Есть несколько клиентских интерфейсов. Но сервер раздает ip праллельно из обоих пулов. Те если подключится 10 клентов то 5 получат из 1.1.1.128 и 5 из 2.2.2.0. А хочется что бы сначала полностью утилизировалась сеть 1.1.1.128, и потом следующие. Нужно что бы мониторить состояние только последней сети. если кончилась уже и она то «туши свет»
Как то можно задать приоритет пулам? (в примере их 2, но планируется таких сетей около 30)

cisco:

interface Loopback1
 description C_SUBNET_CLENTS
 ip address 1.1.1.129 255.255.255.128
 ip address 2.2.2.1 255.255.255.0 secondary
!
interface TenGigabitEthernet0/2/0.794
 description VLAN794
 encapsulation dot1Q 794
 ip dhcp relay information option subscriber-id C_SUBNET_CLENTS
 ip dhcp relay information option-insert 
 ip unnumbered Loopback1

dhcp.conf
class "C_SUBNET_CLENTS" {
match if option agent.subscriber-id = 43:5F:53:55:42:4E:45:54:5F:43:4C:45:4E:54:53;
}
subnet 1.1.1.128 netmask 255.255.255.128 {
  option routers 1.1.1.129;
  option subnet-mask 255.255.255.128;
  option interface-mtu 1500;
   pool {
    range 1.1.1.130 1.1.1.254;
    allow members of "C_SUBNET_CLENTS";
    failover peer "dhcp";
   }
}

subnet 2.2.2.0 netmask 255.255.255.0 {
  option routers 2.2.2.1;
  option subnet-mask 255.255.255.0;
  option interface-mtu 1500;
   pool {
    range 2.2.2.2 2.2.2.254;
    allow members of "C_SUBNET_CLENTS";
    failover peer "dhcp";
   }
}



Последнее исправление: DeeZ (всего исправлений: 1)

Костыли какие-то придется городить:

1. Если сети можно объединить (не ваш случай) то:

If so, you can create the shared-subnet with the supernet, and create
several pools inside it.

subnet 192.168.0.0/255.255.252.0 {
 range 192.168.0.10 192.168.0.254;
 range 192.168.1.10 192.168.1.254;
 range 192.168.2.10 192.168.2.254;
 range 192.168.3.10 192.168.3.254;
 option routers 192.168.0.1;
}

Еще два костыля:

1) Run a monitor that enables a pool as required

 Well that's it really, write a script that periodically checks the 
 status of your leases and if it detects that there are no free 
 addresses in the main pool will re-configure the server to allow it 
 to use addresses from the backup pool. When it detects free addresses 
 then you reconfigure the server again - but be aware that this will 
 most likely cause a client in the backup pool to switch address (and 
 thus lose all existing connections) on lease renewal.


 2) Rely on undocumented behaviour to control address use order.

 The server as currently written will allocate addresses starting at 
 the top of pools (and IIRC, the highest address when multiple pools 
 are available). You could exploit this to ensure that initially 
 clients would get addresses from one pool rather than another.

 BUT - this only works while addresses in the main pool are unused 
 (not free, but totally unused as in never been issued before).

 You would need to run a cleanup process to periodically remove all 
 trace of expired leases in the main from the lease database so that 
 the address could then be used preferentially.

 This will not however allow for a client getting back into the main 
 pool as it will continue using it's address in the backup pool until 
 something 
forces it to change.

Much better of course to ensure that you have enough addresses for customers !

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.