Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZTP over the me0 port for switches #806

Open
sarcasticadmin opened this issue Dec 6, 2024 · 2 comments
Open

ZTP over the me0 port for switches #806

sarcasticadmin opened this issue Dec 6, 2024 · 2 comments

Comments

@sarcasticadmin
Copy link
Member

Description

From the second work party there was discussion around ZTP

Prototype KEA config that will allow for loading of a zeroized ex4200-48p (or px) with the specified JunOS version and a copy of miniconfig through ZTP over the me0 port.

Acceptance Criteria

  • miniconfig is able to be loaded through ZTP over the me0 port
@owendelong
Copy link
Collaborator

Kea Config has been prototyped and tested in my home environment. Kea stanzas still need to be isolated and optimized for handling more than one type of switch (for example, current setup handles only ex4200-48p, minor additional configuration is needed for ex4200-48px, and more significant configuration will be needed to add the ability to handle ex4300-48p).

I'm hoping that with some luck, I'll be able to get at least one ex4300-48p into a test environment soon.

@owendelong
Copy link
Collaborator

owendelong commented Dec 12, 2024

Here are all the additions to kea-dhcp4.conf to make ZTP work.

Where elipses (...) appear in the quoted text below, they represent redactions of the kea config file that were not relevant to ZTP for the Juniper. Further, the range 1-20 is reserved for systems participating in the flashing process.

Note that the DHCP range assigned for handing out addresses will NOT conflict with the configured switch address of 192.168.255.76 in order to avoid interfering with the operations of the switch once miminconfig or another configuration is loaded. The HTTP server is expected to be at 192.168.255.20.

{
  "Dhcp4": {
       ...
    // Vendor Specific and Custom Option Definitions (Global)
    "option-def": [
      // Juniper ZTP Options
      {   
        "name": "image-file-name",
        "code": 0,
        "space": "Juniper-ZTP",
        "type": "string",
        "record-types": "",
        "array": false
      },    
      {     
        "name": "config-file-name",
        "code": 1,
        "space": "Juniper-ZTP",
        "type": "string",
        "record-types": "",
        "array": false
      },  
      {     
        "name": "image-file-type",
        "code": 2,
        "space": "Juniper-ZTP",
        "type": "string",
        "record-types": "",
        "array": false
      },
      {
        "name": "transfer-mode",
        "code": 3,
        "space": "Juniper-ZTP",
        "type": "string",
        "record-types": "",
        "array": false
      },
      {
        "name": "alt-image-file-name",
        "code": 4,
        "space": "Juniper-ZTP",
        "type": "string",
        "record-types": "",
        "array": false
      },
      {
        "name": "http-port",
        "code": 5,
        "space": "Juniper-ZTP",
        "type": "string",
        "record-types": "",
        "array": false
      },
      {
        "name": "ftp-timeout",
        "code": 7,
        "space": "Juniper-ZTP",
        "type": "string",
        "record-types": "",
        "array": false
      }
    ],
    ...
    "subnet4": [
      ...
      {
        "id": 4,
        "subnet": "192.168.255.0/24",
        "option-data": [
          {
            "space": "dhcp4",
            "name": "subnet-mask",
            "code": 1,
            "data": "255.255.255.0"
          },
          {
            "space": "dhcp4",
            "name": "tftp-server-name",
            "code": 66,
            "data": "192.168.255.20"
          }
        ],
        "pools": [
          {
            "pool": "192.168.255.21 - 192.168.255.70"
          }
        ],
        "client-class":  "Juniper-ZTP-ex4200-48p"
      }
    ],
    "client-classes": [
      ...
      {
        "name": "Juniper-ZTP-ex4200-48p",
        "test": "option[60].text == 'Juniper-ex4200-48p'",
        "option-def": [
          {
            "name": "vendor-encapsulated-options",
            "code": 43,
            "type": "empty",
            "encapsulate": "Juniper-ZTP"
          }
        ],
        "option-data": [
          {
            "name": "config-file-name",
            "space": "Juniper-ZTP",
            "data": "config/miniconfig"
          },
          {
            "name": "image-file-name",
            "space": "Juniper-ZTP",
            "data": "images/jinstall-ex-4200-15.1R7.9-domestic-signed.tar.gz"
          },
          {
            "name": "transfer-mode",
            "space": "Juniper-ZTP",
            "data": "http",
          },
          {
            "name": "tftp-server-name",
            "data": "192.168.255.20"
          },
          {
            "name": "vendor-encapsulated-options"
          }
        ]
      }
    ]
  }
}

I also set up a simple apache instance to serve up config/miniconfig and the install image from images/jinstall-ex4200...

These were placed in the default /var/www/html HTML Root that apache2 packages for linux ship with.

IIRC, that was all that was needed in order to make ZTP work. My recommendation would be to add both of these capabilities to the stock image we use for NIX to contain the tools to flash switches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants