1

I am trying to use the ZTP approach to configure my router [R2]. My Ubuntu machine is both DHCP and TFTP server.

Ubuntu [DHCP Server]: 16.04.5 LTS Cisco Router [DHCP Client]: 7200, version 15.2(4)S5

This is the python script- ztp.py. ztp.py is stored in /var/lib/tftpboot/

#!/usr/bin/env python3.5.2

import time
import cli

time.sleep(200)
print ("\n\n *** ZTP Day 0 Configuation *** \n\n")

fn = open('TXJla-outgoing/R1.txt','r')
fn.seek(0)
c =fn.readlines()
fn.close()

cli.configurep([c])

The configuration on dhcpd.conf for host R2 is -

host R2 {
  hardware ethernet CA:02:3B:E3:00:08;
  fixed-address 198.51.100.5;
  option bootfile-name !<opt 67> "/ztp.py";
  option tftp-server-name !<opt 150> "198.51.100.2";
}

The configuration is not exected on the Router. Please help resolve.

Prarthana Shedge
  • 135
  • 1
  • 3
  • 11

1 Answers1

0

In my setup (Cisco device as DHCP server, and debian as tftp)I did not needed the option 150.

Code on the CiscoDHCPServer:

   ip dhcp pool ztp
       network "networkip" "SNM"   
       default-router "Default gateway"    
       dns-server "ip"             
       option 67 ascii http://"ip of debian":80/zeroday.py

Also the location of the code is in /var/www/html/ But I'm noit sure wheter this will change anything

Michael
  • 57
  • 9