Defina as opções encapsuladas do fornecedor (código 125) com o ISC DHCPd 4.3 falha

0

Estou tentando configurar o meu servidor Ubuntu 16.04 LTS Xenial para executar um servidor DHCP que forneça as informações necessárias para um dispositivo muito específico.

Esse dispositivo é um decodificador de TV da Orange ISP (o fornecedor francês é Sagem) e só funciona se o endereço IP for atribuído pelo Livebox 3 da Orange (TM) (mesmo fornecedor). Essa restrição evita que um servidor DHCP diferente do fornecido pela Orange também.

Se eu quiser usar meu próprio servidor DHCP em execução no Ubuntu 16.04 para evitar o que está em execução no Livebox (é uma porcaria), preciso adaptar minha configuração.

Bootstrap Protocol (ACK) usando decodificador de TV e DHCP, ambos da Sagem

Message type: Boot Reply (2)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x35139a37
Seconds elapsed: 0
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 192.168.1.153
Next server IP address: 192.168.1.1
Relay agent IP address: 0.0.0.0
Client MAC address: Sagemcom_37:a1:9a (f0:82:61:37:a1:9a)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (ACK)
    Length: 1
    DHCP: ACK (5)
Option: (54) DHCP Server Identifier
    Length: 4
    DHCP Server Identifier: 192.168.1.1
Option: (51) IP Address Lease Time
    Length: 4
    IP Address Lease Time: (843s) 14 minutes, 3 seconds
Option: (58) Renewal Time Value
    Length: 4
    Renewal Time Value: (421s) 7 minutes, 1 second
Option: (59) Rebinding Time Value
    Length: 4
    Rebinding Time Value: (737s) 12 minutes, 17 seconds
Option: (1) Subnet Mask
    Length: 4
    Subnet Mask: 255.255.255.0
Option: (6) Domain Name Server
    Length: 4
    Domain Name Server: 192.168.1.1
Option: (15) Domain Name
    Length: 4
    Domain Name: home
Option: (28) Broadcast Address
    Length: 4
    Broadcast Address: 192.168.1.255
Option: (3) Router
    Length: 4
    Router: 192.168.1.1
Option: (125) V-I Vendor-specific Information
    Length: 41
    Enterprise: The Broadband Forum (formerly 'ADSL Forum') (3561)
        Length: 36
        Option 125 Suboption: (4) GatewayManufacturerOUI
            Length: 6
            GatewayManufacturerOUI: 307CB2
        Option 125 Suboption: (5) GatewaySerialNumber
            Length: 15
            GatewaySerialNumber: AN16XXXXXXXXXX
        Option 125 Suboption: (6) GatewayProductClass
            Length: 9
            GatewayProductClass: Livebox 3
Option: (255) End
    Option End: 255

Para emular o mesmo comportamento do meu próprio servidor ISC DHCP no Ubunti, eu o havia personalizado com base na documentação e nas opções encontradas.

Basicamente, o objetivo é enviar apenas ao decodificador de TV os seguintes códigos adicionais:

  • Código 15: nome de domínio
  • Código 72: Servidor padrão da World Wide Web.
  • Código 125: Informações específicas do fornecedor V-I

Com base na documentação do servidor ISC DHCP, os três códigos existem e podem ser facilmente enviados adicionando as opções convenientes:

  • texto do nome do domínio
  • www-server ip-address
  • cadeia de opções encapsuladas por fornecedor

Primeiramente, tentei assim:

/etc/dhcp/dhcpd.conf

# Create an option namespace called orangetv
option space orangetv code width 1 length width 1;
option orangetv.GatewayManufacturerOUI code 4 = text;
option orangetv.GatewaySerialNumber code 5 = text;
option orangetv.GatewayProductclass code 6 = text;

# Linux Router
subnet 192.168.1.0 netmask 255.255.255.0 {
    option domain-name-servers 192.168.1.1;
    option broadcast-address 192.168.1.255;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.5;
    range 192.168.1.100 192.168.1.199;    
    class "sagem-vendor-classes" {
    match if substring(option vendor-class-identifier, 0, 5) = "sagem";        
    option domain-name "home";        
    option www-server 193.253.67.89;
    vendor-options-space orangetv;
    option orangetv.GatewayManufacturerOUI "307CB2";
    option orangetv.GatewaySerialNumber "AN16XXXXXXXXXXX";
    option orangetv.GatewayProductclass "Livebox 3";                       
    }

}

Quando a nova configuração foi salva, verifiquei a sintaxe de configuração executando:     sudo dhcpd -t -cf /etc/dhcp/dhcpd.conf

Depois, reiniciei o servidor DHCP para recarregar a nova configuração (o ISC DHCP 4.3 falha algumas vezes para reiniciar e recarregar a nova configuração. Isso está de alguma forma relacionado ao servidor Apache2. Por isso, sugiro forçá-lo):

sudo -i
service dhcp restart
service isc-dhcp-server restart
service isc-dhcp-server6 restart
service apache2 restart

Agora, reiniciei a TV Decoded e segui a rede com o Wireshark novamente. O resultado do Bootstrap ACK foi

Message type: Boot Reply (2)
Hardware type: Ethernet (0x01)
Hardware address length: 6
Hops: 0
Transaction ID: 0x70907f18
Seconds elapsed: 0
Bootp flags: 0x8000, Broadcast flag (Broadcast)
Client IP address: 0.0.0.0
Your (client) IP address: 192.168.1.153
Next server IP address: 192.168.1.5
Relay agent IP address: 0.0.0.0
Client MAC address: Sagemcom_37:a1:9a (f0:82:61:37:a1:9a)
Client hardware address padding: 00000000000000000000
Server host name not given
Boot file name not given
Magic cookie: DHCP
Option: (53) DHCP Message Type (ACK)
    Length: 1
    DHCP: ACK (5)
Option: (54) DHCP Server Identifier
    Length: 4
    DHCP Server Identifier: 192.168.1.5
Option: (51) IP Address Lease Time
    Length: 4
    IP Address Lease Time: (843s) 14 minutes, 3 seconds
Option: (1) Subnet Mask
    Length: 4
    Subnet Mask: 255.255.255.0
Option: (3) Router
    Length: 4
    Router: 192.168.1.5
Option: (6) Domain Name Server
    Length: 4
    Domain Name Server: 192.168.1.1
Option: (15) Domain Name
    Length: 4
    Domain Name: home
Option: (28) Broadcast Address
    Length: 4
    Broadcast Address: 192.168.1.255
Option: (72) Default WWW Server
    Length: 4
    Default WWW Server: 193.253.67.89
Option: (255) End
    Option End: 255
Padding: 0000000000000000

Como você percebe, as opções 15 e 72 foram analisadas corretamente pela opção 125 está ausente. Então, tentei usar as opções de fornecedor encapsulado, conforme recomendado no manual. Eu usei

option vendor-encapsulated-options 7d:29:00:00:0d:XXXXXXXX:20:33

em vez do método vendor-options-space, mas falhou novamente.

Eu usei outra solução alternativa para enviar o código 125, conforme explicado em [ link

/etc/dhcp/dhcpd.conf

# Create an option namespace called orangetv
option space orangetv code width 1 length width 1;
option orangetv.GatewayManufacturerOUI code 4 = text;
option orangetv.GatewaySerialNumber code 5 = text;
option orangetv.GatewayProductclass code 6 = text;

# Package the orangetv namespace into option 125
option space vivso code width 4 length width 1;
option vivso.orangetv code 3561 = encapsulate orangetv;
option vivso.iana code 0 = string;
option op125 code 125 = encapsulate vivso;

# Linux Router
subnet 192.168.1.0 netmask 255.255.255.0 {
    option domain-name-servers 192.168.1.1;
    option broadcast-address 192.168.1.255;
    option subnet-mask 255.255.255.0;
    option routers 192.168.1.5;
    range 192.168.1.100 192.168.1.199;    
    class "sagem-vendor-classes" {
    match if substring(option vendor-class-identifier, 0, 5) = "sagem";        
    option domain-name "home";        
    option www-server 193.253.67.89;
    option vivso.iana 01:01:01;
    option orangetv.GatewayManufacturerOUI "307CB2";
    option orangetv.GatewaySerialNumber "AN16XXXXXXXXXXX";
    option orangetv.GatewayProductclass "Livebox 3";                       
    }

}

Apesar das configurações, o servidor DHCP não está enviando o código 125 para ganhar as especificações do fornecedor.

Alguma outra sugestão?

    
por Jaime 24.08.2017 / 00:40

1 resposta

0

tente isso

option op125 code 125 = string;

em seguida, insira o op125 no bloco de sub-rede como:

option op125 7d:29:00:00:0d:XXXXXXXX:20:33;

A vendor-encapsulated-options é a opção 43

    
por Bigfei 05.04.2018 / 21:02