AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / server / Perguntas / 914774
Accepted
gmazoyer
gmazoyer
Asked: 2018-06-02 05:13:22 +0800 CST2018-06-02 05:13:22 +0800 CST 2018-06-02 05:13:22 +0800 CST

Classes ISC-DHCPD para ZTP (com Juniper)

  • 772

Atualmente, estou tentando configurar um servidor DHCP para usá-lo em um ambiente ZTP. Meu primeiro objetivo é poder atualizar meus dispositivos Juniper automaticamente com base no hardware.

O que estou realmente tentando alcançar é enviar o software JUNOS adequado para o hardware Juniper adequado. Por exemplo, um MX104 deve baixar uma imagem direcionada MX104 e um EX4550 deve baixar uma imagem direcionada EX4550.

Até agora, configurei um servidor DHCP com sucesso com o do ISC. Mas isso bem simples até aqui.

Agora estou tentando brincar com classes e pools para corresponder ao conjunto de identificador de classe de fornecedor definido para o pool adequado.

A configuração do meu servidor DHCP é a seguinte:

option domain-name "example.com";
option domain-name-servers 8.8.8.8, 8.8.4.4;
option domain-search "example.com";

set vendor-string = option vendor-class-identifier;
option ztp-file-server code 150 = { ip-address };
option space ztp-ops;
option ztp-ops.image-file-name code 0 = text;
option ztp-ops.config-file-name code 1 = text;
option ztp-ops.image-file-type code 2 = text;
option ztp-ops.transfer-mode code 3 = text;
option ztp-ops-encapsulation code 43 = encapsulate ztp-ops;

class "juniper-mx10003" {
  match if substring(option vendor-class-identifier, 0, 15) = "Juniper-mx10003";
}

subnet 10.24.0.0 netmask 255.255.0.0 {
  default-lease-time 600;
  max-lease-time 86400;
  option routers 10.24.0.1;
  range 10.24.254.0 10.24.254.254;
  # Address pool(s)
  pool {
    range 10.24.253.0 10.24.253.10;
    allow members of "juniper-mx10003";
    option ztp-file-server 10.24.1.2;
    option ztp-ops.transfer-mode "http";
    option ztp-ops.image-file-name "/junos-vmhost-install-mx-x86-64-18.1R1.9.tgz";
  }
}

E eu tenho uma configuração Juniper para o meu MX10003 como o seguinte:

system {
    root-authentication {
        encrypted-password "YEAH"; ## SECRET-DATA
    }
    syslog {
        user * {
            any emergency;
        }
        file messages {
            any notice;
            authorization info;
        }
        file interactive-commands {
            interactive-commands any;
        }
    }
}
interfaces {
    fxp0 {
        unit 0 {
            family inet {
                dhcp {
                    vendor-id Juniper-mx10003;
                }
            }
        }
    }
}

Ao inicializar ou limpar e solicitar uma concessão, o MX está solicitando um endereço IP, mas este é um da faixa de 10.24.254.0 a 10.24.254.254 que é atribuído e não de 10.24.253.0 a 10.24.253.10.

Eu tentei despejar as trocas DHCP com dhcpdump e aqui está o que ele encontra:

  TIME: 2018-06-01 15:07:50.357
    IP: 0.0.0.0 (d8:18:d3:1e:a9:66) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 52cccd10
  SECS: 0
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: d8:18:d3:1e:a9:66:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         1 (DHCPDISCOVER)
OPTION:  60 ( 15) Vendor class identifier   Juniper-mx10003
OPTION:  51 (  4) IP address leasetime      86400 (24h)
---------------------------------------------------------------------------

  TIME: 2018-06-01 15:07:51.297
    IP: 10.24.1.2 (0:c:29:8:a6:dd) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 52cccd10
  SECS: 0
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 10.24.254.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: d8:18:d3:1e:a9:66:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         2 (DHCPOFFER)
OPTION:  54 (  4) Server identifier         10.24.1.2
OPTION:  51 (  4) IP address leasetime      86400 (24h)
OPTION:   1 (  4) Subnet mask               255.255.0.0
OPTION:   3 (  4) Routers                   10.24.0.1
OPTION:   6 (  8) DNS server                8.8.8.8,8.8.4.4
OPTION: 119 ( 30) Domain Search             0a6c75786e657477 .example
                                            6f726b0269       .com.
OPTION:  15 ( 13) Domainname                example.com
---------------------------------------------------------------------------

  TIME: 2018-06-01 15:07:51.302
    IP: 0.0.0.0 (d8:18:d3:1e:a9:66) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 1 (BOOTPREQUEST)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 52cccd10
  SECS: 0
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 0.0.0.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: d8:18:d3:1e:a9:66:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  54 (  4) Server identifier         10.24.1.2
OPTION:  55 ( 14) Parameter Request List      3 (Routers)
                                             51 (IP address leasetime)
                                              1 (Subnet mask)
                                             15 (Domainname)
                                              6 (DNS server)
                                             66 (TFTP server name)
                                             67 (Bootfile name)
                                            120 (SIP Servers DHCP Option)
                                             44 (NetBIOS name server)
                                             43 (Vendor specific info)
                                            150 (???)
                                             12 (Host name)
                                              7 (Log server)
                                             42 (NTP servers)

OPTION:  50 (  4) Request IP address        10.24.254.0
OPTION:  53 (  1) DHCP message type         3 (DHCPREQUEST)
OPTION:  60 ( 15) Vendor class identifier   Juniper-mx10003
OPTION:  51 (  4) IP address leasetime      86400 (24h)
---------------------------------------------------------------------------

  TIME: 2018-06-01 15:07:51.398
    IP: 10.24.1.2 (0:c:29:8:a6:dd) > 255.255.255.255 (ff:ff:ff:ff:ff:ff)
    OP: 2 (BOOTPREPLY)
 HTYPE: 1 (Ethernet)
  HLEN: 6
  HOPS: 0
   XID: 52cccd10
  SECS: 0
 FLAGS: 7f80
CIADDR: 0.0.0.0
YIADDR: 10.24.254.0
SIADDR: 0.0.0.0
GIADDR: 0.0.0.0
CHADDR: d8:18:d3:1e:a9:66:00:00:00:00:00:00:00:00:00:00
 SNAME: .
 FNAME: .
OPTION:  53 (  1) DHCP message type         5 (DHCPACK)
OPTION:  54 (  4) Server identifier         10.24.1.2
OPTION:  51 (  4) IP address leasetime      86400 (24h)
OPTION:   1 (  4) Subnet mask               255.255.0.0
OPTION:   3 (  4) Routers                   10.24.0.1
OPTION:  15 ( 13) Domainname                example.com
OPTION:   6 (  8) DNS server                8.8.8.8,8.8.4.4
---------------------------------------------------------------------------

Alguém tentou fazer a mesma coisa? Talvez haja algo óbvio que estou perdendo?

debian
  • 1 1 respostas
  • 1323 Views

1 respostas

  • Voted
  1. Best Answer
    gmazoyer
    2018-06-05T06:15:49+08:002018-06-05T06:15:49+08:00

    Depois de remover a range 10.24.254.0 10.24.254.254;linha de configuração, tudo está OK. As instruções classe matchestão realmente funcionando e pude confirmar isso definindo uma nova classe para outro tipo de hardware.

    Aqui está a configuração adequada usada agora:

    #
    # Classes
    #
    class "juniper-mx10003" {
      match if (option vendor-class-identifier = "Juniper-mx10003");
    }
    class "juniper-qfx5110" {
      match if (option vendor-class-identifier = "Juniper-qfx5110-48s-4c");
    }
    #
    # Subnet declarations
    #
    subnet 10.24.0.0 netmask 255.255.0.0 {
      default-lease-time 600;
      max-lease-time 86400;
      option routers 10.24.0.1;
      # Address pool(s)
      pool {
        range 10.24.253.0 10.24.253.9;
        allow members of "juniper-mx10003";
        option ztp-file-server 10.24.1.2;
        option ztp-ops.transfer-mode "http";
        option ztp-ops.image-file-name "/junos-vmhost-install-mx-x86-64-18.1R1.9.tgz";
      }
      pool {
        range 10.24.253.10 10.24.253.19;
        allow members of "juniper-qfx5110";
        option ztp-file-server 10.24.1.2;
        option ztp-ops.transfer-mode "http";
        option ztp-ops.image-file-name "/jinstall-host-qfx-5e-flex-15.1X53-D233.1-secure-domestic-signed.tgz";
      }
    }
    
    • 0

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve