product
Application for evaluation machine
Automatic configuration of white Box switches with OcNOS and ZTP

Introduction
This is the 4th article on Open Networking, which has been posted regularly. In this article, Zero Touch Provisioning (ZTP) is explained using a network OS (NOS) called OcNOS as an example.
There are other articles related to Open Networking, so please see the articles that interest you from the "List of articles" below.
White Box Switch Automation: OcNOS and ZTP Basics
What is OcNOS?
OcNOS is a commercial Network Operating System (NOS) for white Box switches provided by IP Infusion, Inc. It was developed based on ZebOS, the embedded software that the company provides to vendors of network equipment such as switches and routers.
While maintaining its rich functionality, quality, and reliability, it supports a command system that network engineers are familiar with, allowing you to achieve cost benefits (reduced CAPEX and OPEX) and the freedom and advantages of open networking without changing your existing network configuration or operations.
In addition to the basic L2/L3 functions of ZebOS, OcNOS supports a wide range of protocols, including VXLAN and MPLS functions. Multiple software packages are available for various network applications, from enterprises to service providers, allowing users to select the package that best suits their needs.
What is ZTP (Zero Touch Provisioning)?
First, let me explain the overview of ZTP.
ZTP is a mechanism that allows devices such as switches to be automatically configured and used simply by connecting them to the network you want to introduce them to and turning them on.
Previously, when using devices such as switches, administrators had to update the OS to the latest version and perform initial settings and configuration tasks to suit the operating environment.
With ZTP, administrators prepare the OS and configuration data in advance, and when devices are connected to the operating environment, the OS is automatically downloaded and the configuration data is referenced to perform the configuration work. This reduces the amount of configuration work that administrators have to do for each device, which is expected to reduce time and costs.
ZTP processing flow
Next, we will explain the process flow until the configuration work is completed using ZTP.
This time, we will use the simple network configuration below as an example to explain the process until switch configuration is complete.

Simple network diagram
1. Start the switch with the LAN cable for Network = 192.168.0.0/24 connected to the management port of the switch.
2. When the switch starts up, it sends a DHCP request (① in the diagram).
3. The DHCP Server responds with an Ack to the DHCP Request from the switch (② in the configuration diagram).
At this time, not only the IP address but also the location where the NOS image file, License, and Config file are saved will be returned.
In this case, the storage location is a Web (HTTP) Server, so the response returns the URLs of the NOS image file and License stored on the Web Server.
4. The switch accesses the Web Server (③ in the configuration diagram).
5. Download the NOS image file, license, and configuration file from the Web Server (④ in the configuration diagram).
6. Apply the downloaded files to the switch and the configuration will be complete.
How to set up ZTP in OcNOS
Now, let's take a look at the specific steps for setting up ZTP using OcNOS.
In this example configuration, we will use the following network configuration:
We will unify DHCP and Web Server on Ubuntu Server (version 16.04). In this case, Web Server will run as HTTP.
The switch used was Edgecore's white Box switch, AS7726-32X, and ZTP was used to perform tasks from downloading OcNOS (version 1.3.9) to initialization.

Network configuration diagram using ZTP
1. Configuring DHCP Server
First, we will explain how to configure the DHCP Server.
The DHCP Server must be configured with the storage location (URL) of the OcNOS NOS image file, License, and Config file.
1-1. Download the DHCP package
First, to set up the DHCP Server, download the DHCP package to the Server using the command “sudo apt install isc-dhcp-server”.
1-2. Editing dhcpd.conf (IP address range to be distributed)
Edit /etc/dhcp/dhcpd.conf included in the downloaded package.
In this example, the network to which Ubuntu Server belongs is 192.168.0.0/24. If you want to set the range of IP addresses you want to distribute via DHCP to be 192.168.0.41 – 192.168.0.49, edit it as follows:
subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.41 192.168.0.49; #割り当てるIPアドレスの範囲 default-lease-time 21600; #クライアントが期限を求めない場合の割り当て期間(秒) max-lease-time 43200; #クライアントが期限を求めた場合の割り当て期間(秒) }
1-3. Editing dhcpd.conf (specifying the file location)
Edit the file locations as follows:
Use the DHCP option to specify the URL under /var/www/html/ on the HTTP Server.
default-url is the URL of the NOS image file, ocnos-license-url is the URL of the License, and ocnos-provision-url is the URL of the Config file.
The user can freely set the hostname, and enter the MAC address of Eth0 of AS7726-32X in hardware ethernet, and the IP address you want to set to Eth0 of AS7726-32X in fixed-address.
option ocnos-license-url code 251 = text; #DHCPオプション option ocnos-provision-url code 250 = text; #DHCPオプション host AS7726-A { #ホスト名 hardware ethernet 04:f8:f8:XX:XX:XX; #Eth0のMACアドレス fixed-address 192.168.0.70; #Eth0に設定したいIPアドレス option default-url = "http://192.168.0.80/ocnos/OcNOS-installer"; #NOS image fileの保存場所 option ocnos-license-url = "http://192.168.0.80/ocnos/license.tar"; #Licenseの保存場所 option ocnos-provision-url = "http://192.168.0.80/ocnos/AS7726-A.conf"; #Config fileの保存場所 }
1-4. Restart the DHCP Server
Finally, restart the isc-dhcp-server with the command below to complete the DHCP Server configuration.
sudo systemctl enable isc-dhcp-server sudo systemctl restart isc-dhcp-server
2. HTTP Server Configuration
Next, I will explain the HTTP Server settings.
2-1. Download the Apache2 package
Download the Apache2 package with the command “sudo apt install apache2”.
2-2. Firewall settings
You need to allow access to the web port from outside, so configure the firewall with the command “sudo ufw allow 'apach'”.
2-3. Restart the HTTP Server
As with DHCP, restart Apache2 with the following command.
sudo systemctl enable apache2.service sudo systemctl restart apache2.service
2-4. Checking access to the HTTP Server
Finally, check whether you can access the restarted HTTP Server (http://192.168.0.80). Please note that the device (PC, Server, etc.) used to check access must be connected to the same network as the HTTP Server.
If you can access it, you will see an image of Apache2 like the one below.

Apache2 displayed as running as HTTP Server
After confirming that the HTTP Server is working successfully, create the ocnos directory under /var/www/html.
Then, by storing the NOS image file, License, and Config file in the ocnos directory, the HTTP Server configuration is complete.
3. Configuring the switch (AS7726-32X)
Finally, let's talk about setting up the AS7726-32X.
The AS7726-32X is equipped with a bootloader and NOS installation mechanism called ONIE. When you start the AS7726-32X, the following screen will be displayed and ONIE will start automatically.

ONIE stands up
This ONIE starts searching for a DHCP server and then executes ZTP when it sends a request to the DHCP server. The user simply needs to connect the management port of the AS7726-32X and power it on to complete the configuration process.
The figure below is the log of the part where ONIE obtains the license and configuration file from the DHCP server.

How ONIE obtains from DHCP Server
ZTP and Ansible Integration
For ZTP only, to change the settings of the AS7726-32X, you must edit the configuration on the HTTP Server, download the edited configuration to the AS7726-32X, and then restart it.
However, by combining Ansible and ZTP, which we introduced in the second and third blogs, you can eliminate this hassle and make it possible to change settings in real time.
For specific details on how to integrate with Ansible, please refer to the 7th blog post.
This concludes the setup of ZTP. In the next article, we will explain ecSONiC, a type of NOS that was also mentioned in this article.
At the end
Macnica provides a service that remotely provides an environment where you can experience open networking and conduct tests and verifications.
This service allows us to verify the operability of network OSes and perform tests that combine network OSes from various manufacturers, white Box switches, and optical transceivers.

Image of remote verification service
It is a service that allows you to easily verify open networking, and the basic configuration is free of charge.
You can check the downloadable materials for available network OS and white Box switches, specific use cases, and how to apply. The materials can be downloaded from the URL listed in the information email by answering the questionnaire from the "Macnica Network OS Remote Verification Service" below.
These people are using the remote verification service.

Here are some testimonials from people who have actually used the service.
Furukawa Network Solution Co., Ltd.
“Recently, the number of remote service environments is increasing, but I was impressed with the ease of access to the evaluation equipment.
The materials you provided were easy to understand, and we were able to proceed smoothly with the intended verification. ”
Related information

[Ansible for Beginners] Automatically build a BGP cross-network! Starting network construction with Ansible Part 1

[Ansible for Beginners] Automatically generate network configuration files! Starting network construction with Ansible Part 2

How to automatically configure a white Box switch network for beginners ~ZTP x An...
Click here for list of materials
In addition to introducing products handled by Macnica,
We publish materials related to open networking, such as BGP cross network automatic construction files and network operation test evaluation reports.
Click here for details
Product Page Top
Edgecore Networks
We continue to be a pioneer in open networking by developing and selling products related to OpenNetworking/white Box switches.
Aviz Networks
We are pioneers of SONiC, an open source network operating system, providing observability, configuration automation tools and support from a team of SONiC experts.
IP Infusion
As a market leader among open networking providers, we provide reliable network solutions to over 600 customers, including carriers, service providers, and data centers.
Inquiry/Document request
In charge of Macnica Edgecore Networks
- TEL:045-470-9831
- E-mail:projectmonstar@macnica.co.jp
Weekdays: 9:00-17:00