Difference between revisions of "Juniper ZTP/Homer"
| Line 54: | Line 54: | ||
include "/etc/dhcp/juniper_ztp"; | include "/etc/dhcp/juniper_ztp"; | ||
} | } | ||
| + | |||
| + | === DNS entries for the 4 switches | ||
| + | |||
| + | $ORIGIN 0.193.10.in-addr.arpa. | ||
| + | --- | ||
| + | 101 1H IN PTR lsw1-a1-dfw.mgmt.dfw.labnet. | ||
| + | 102 1H IN PTR lsw1-a2-dfw.mgmt.dfw.labnet. | ||
| + | 103 1H IN PTR lsw1-a3-dfw.mgmt.dfw.labnet. | ||
| + | 104 1H IN PTR lsw1-a4-dfw.mgmt.dfw.labnet. | ||
| + | |||
| + | $ORIGIN mgmt.dfw.labnet. | ||
| + | --- | ||
| + | lsw1-a1-dfw 1H IN A 10.193.0.101 | ||
| + | lsw1-a2-dfw 1H IN A 10.193.0.102 | ||
| + | lsw1-a3-dfw 1H IN A 10.193.0.103 | ||
| + | lsw1-a4-dfw 1H IN A 10.193.0.104 | ||
Revision as of 14:45, 5 February 2023
Goal
In this Tutorial, we are going to setup a ZTP environment to be able to run the basic configuration on a new Juniper switch. Once the basic configuration is done, we will run homer to deploy the switch configuration. If you want to know more about homer please check: https://wikitech.wikimedia.org/wiki/Homer
Prerequisites
For this tutorial I will be using :
- EVE-NG 2.0.3-112
- VQFX model: vqfx-10000 running JUNOS 19.4R1.10
- DHPC/TFTP VM (IP:10.192.16.5/install1001.dfw.labnet)
- Homer VM(IP:10.192.32.17/homer1001.dfw.labnet)
- Netbox VM(IP:10.192.32.3/netbox1001.dfw.labnet)
- DNS server(IP:10.192.16.2/ns0.dfw.labnet)
All the VM's are running on Proxmox 7.3.4
Diagram
Setup and Configuration
The section is the just the section needed to make ztp work.
Note: We will generate the juniper_ztp file using later on a python script
DHCP configuration
#######################################################################
# ZTP Sample Config begins here:
#######################################################################
option option-150 code 150 = ip-address;
set vendor-string = option vendor-class-identifier;
option space ZTP;
option ZTP.image-file-name code 0 = text;
option ZTP.config-file-name code 1 = text;
option ZTP.image-file-type code 2 = text;
option ZTP.transfer-mode code 3 = text;
option ZTP.alt-imagefile-name code 4 = text;
option ZTP-encapsulation code 43 = encapsulate ZTP;
# mgmt nework
subnet 10.193.0.0 netmask 255.255.255.0 {
authoritative;
option subnet-mask 255.255.255.0;
option option-150 10.192.16.5; #TFTP server
option routers 10.193.0.1;
option broadcast-address 10.193.0.255;
option domain-name "mgmt.dfw.labnet";
default-lease-time 600;
max-lease-time 7200;
}
group {
vendor-option-space ZTP;
include "/etc/dhcp/juniper_ztp";
}
=== DNS entries for the 4 switches
$ORIGIN 0.193.10.in-addr.arpa. --- 101 1H IN PTR lsw1-a1-dfw.mgmt.dfw.labnet. 102 1H IN PTR lsw1-a2-dfw.mgmt.dfw.labnet. 103 1H IN PTR lsw1-a3-dfw.mgmt.dfw.labnet. 104 1H IN PTR lsw1-a4-dfw.mgmt.dfw.labnet. $ORIGIN mgmt.dfw.labnet. --- lsw1-a1-dfw 1H IN A 10.193.0.101 lsw1-a2-dfw 1H IN A 10.193.0.102 lsw1-a3-dfw 1H IN A 10.193.0.103 lsw1-a4-dfw 1H IN A 10.193.0.104