[root@localhost etc]#vi dhcpd.conf# dhcpd.conf#default-lease-time 600;max-lease-time 7200;option subnet-mask 255.255.255.0;option routers 192.168.1.1;option option-150 code 150 = ip-address;option space NEW_OP;option NEW_OP.image-file-name code 0 = text;option NEW_OP.config-file-name code 1 = text;option NEW_OP-encapsulation code 43 = encapsulate NEW_OP; ## mapping suboptions 00 and 01 with option 43 (suboption 00 is used to specify the image file name and 01 is for conf file name)
subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.10 192.168.1.20;}
host ez_touch {hardware ethernet b0:c6:9a:6d:db:42; ## MAC address of the ME0 interface, you can also use the dynamic IP allocation and also we can use any of the network port's (MAC add# chassis mac +1) for ZTP fixed-address 192.168.1.66;option option-150 192.168.1.55;option host-name " ez_touch ";option NEW_OP.image-file-name "jinstall-ex-4200-12.3R2.5-domestic-signed.tgz"option NEW_OP.config-file-name "test.conf";}
option NEW_OP.image-file-type code 2 = text;option NEW_OP.transfer-mode code 3 = text;Suboption 02: The symbolic link to the software image file to installoption NEW_OP.image-file-type "symlink";Suboption 03: The transfer mode that the switch uses to access the TFTP/FTP/HTTP serveroption NEW_OP.transfer-mode "ftp"; ## If you don’t specify then by default TFTP
:wq!
[root@localhost etc]#/usr/local/sbin/dhcpd -q -lf /var/db/dhcp.lease -cf /usr/local/etc/dhcpd.conf[root@localhost etc]#/ps aux|grep dhcpd >>make sure the process started[root@localhost etc]#tail -f /var/log/messages ##check the messages log to see any config error and also for DHCP and TFTP transactions
root@> request system zeroizewarning: System will be rebooted and may not boot without configurationErase all data, including configuration and log files? [yes,no] (no) yeswarning: ipsec-key-management subsystem not running - not needed by configuration.warning: zeroizing fpc0Broadcast Message from root(no tty) at 1:35 UTC...Auto-image upgrade started successfullyBroadcast Message from root@(no tty) at 1:35 UTC...ALERT:Auto-image upgrade will start. This can terminate config CLI session(s). Modified configuration will be lost. To stop Auto-image, in CLI do thefollowing: 'edit; delete chassis auto-image-upgrade; commit'.{master:0}root> show interfaces vmePhysical interface: vme, Enabled, Physical link is UpInterface index: 68, SNMP ifIndex: 35Type: Mgmt-VLAN, Link-level type: Mgmt-VLAN, MTU: 1518, Speed: 1000mbpsDevice flags : Present RunningInterface flags: SNMP-TrapsLink type : Full-DuplexLink flags : NoneCurrent address: b0:c6:9a:6d:db:42, Hardware address: b0:c6:9a:6d:db:42Last flapped : NeverInput packets : 66Output packets: 85Logical interface vme.0 (Index 7) (SNMP ifIndex 36)Flags: SNMP-Traps Encapsulation: ENET2Input packets : 66Output packets: 85Protocol inet, MTU: 1500Flags: NoneAddresses, Flags: Is-Preferred Is-PrimaryDestination: 192.168.1/24, Local: 192.168.1.66, >>>>switch has got an IP address from the switchBroadcast: 192.168.1.255
root> show log dhcp_logfile |lastJan 26 04:02:20 DHCPD_OPTION_HOST_NAME: DHCP Host Name Option ez_touchJan 26 04:02:20 router address is 192.168.1.1Jan 26 04:02:20 Written IP address 192.168.1.66 to file /var/db/leases/vme.0Jan 26 04:02:22 Opened file for Writing /var/etc/dcd.dhcpd.confJan 26 04:02:22 Writing interface for vme unit number 0 BEGINSJan 26 04:02:22 Writing interface for vme unit number 0 DONEJan 26 04:02:22 Closed file for Writing /var/etc/dcd.dhcpd.confJan 26 04:02:22 signalled dcd (pid 1271) to overlayJan 26 04:02:22 Searching for route 0.0.0.0 on 7Jan 26 04:02:22 Route entry already exists for 0.0.0.0 on 7Jan 26 04:02:22 About to add static route for dest 0.0.0.0Jan 26 04:02:22 Local addr 192.168.1.66Jan 26 04:02:22 The next hop address is 192.168.1.1 iflindex 2147405176Jan 26 04:02:22 VRF is defaultJan 26 04:02:22 RTT is 16777216Jan 26 04:02:22 rtsock ifd message for vmeJan 26 04:02:22 changed ifd vme to upJan 26 04:02:22 rtsock notified state change for IFD= vmeJan 26 04:02:50 AIU: spawn : /bin/sh /usr/sbin/image_load -G 192.168.1.55 -I vme -O install_reboot -D /var/tmp -C test.conf -F jinstall-ex-4200-12.3R2.5-domestic-signed.tgzroot> show log image_load_log|last[Sat Jan 26 03:56:44 UTC 2013] Directory to store image is valid /var/tmp[Sat Jan 26 03:56:45 UTC 2013] Creating file /var/tmp/jinstall-ex-4200-12.3R2.5-domestic-signed.tgz[Sat Jan 26 03:56:45 UTC 2013] tftp -JM binary -JG 192.168.1.55:test.conf -JI vme[Sat Jan 26 03:56:45 UTC 2013] Received 380 bytes in 0.0 seconds[Sat Jan 26 03:56:45 UTC 2013] Image fetch done[Sat Jan 26 03:56:45 UTC 2013] tftp -JM binary -JG 192.168.1.55:jinstall-ex-4200-12.3R2.5-domestic-signed.tgz -JI vme[Sat Jan 26 03:57:42 UTC 2013] Received 111189814 bytes in 56.1 seconds[Sat Jan 26 03:57:42 UTC 2013] Image fetch done[Sat Jan 26 03:57:50 UTC 2013] request system software add /var/tmp/jinstall-ex-4200-12.3R2.5-domestic-signed.tgz no-validate force[Sat Jan 26 03:58:13 UTC 2013]Checking pending install on fpc0fpc0:WARNING: A reboot is required to install the softwareWARNING: Use the 'request system reboot' command immediately[Sat Jan 26 03:58:13 UTC 2013] Image installation is done[Sat Jan 26 03:58:31 UTC 2013] Shutdown NOW![pid 2585][Sat Jan 26 03:58:31 UTC 2013] Removing /var/run/image_load.pid
root@ez_touch_4200# run show system snapshot media internalfpc0:--------------------------------------------------------------------------Information for snapshot on internal (/dev/da0s1a) (backup)Creation date: Apr 4 13:47:30 2013JUNOS version on snapshot:jbase : ex-12.2R4.5jkernel-ex: 12.2R4.5jcrypto-ex: 12.2R4.5jdocs-ex: 12.2R4.5jswitch-ex: 12.2R4.5jpfe-ex42x: 12.2R4.5jroute-ex: 12.2R4.5jweb-ex: 12.2R4.5fips-mode-powerpc: 12.2R4.5
Information for snapshot on internal (/dev/da0s2a) (primary)Creation date: Mar 23 00:05:08 2013JUNOS version on snapshot:jbase : ex-12.3R2.5jkernel-ex: 12.3R2.5jcrypto-ex: 12.3R2.5jdocs-ex: 12.3R2.5jswitch-ex: 12.3R2.5jpfe-ex42x: 12.3R2.5jroute-ex: 12.3R2.5jweb-ex: 12.3R2.5fips-mode-powerpc: 12.3R2.5root@ez_touch_4200# run show log image_load_log[Sat Mar 23 00:08:05 UTC 2013] Creating /var/run/image_load.pid with 1701[Sat Mar 23 00:08:05 UTC 2013] /usr/sbin/image_load -G 192.168.1.55 -I vme -O install_reboot -D /var/tmp -C test2.conf -F jinstall-ex-4200-12.3R2.5-domestic-signed.tgz[Sat Mar 23 00:08:15 UTC 2013] Directory to store image is valid /var/tmp[Sat Mar 23 00:08:16 UTC 2013] Creating file /var/tmp/jinstall-ex-4200-12.3R2.5-domestic-signed.tgz[Sat Mar 23 00:08:16 UTC 2013] tftp -JM binary -JG 192.168.1.55:test2.conf -JI vme[Sat Mar 23 00:08:16 UTC 2013] Received 3849 bytes in 0.0 seconds[Sat Mar 23 00:08:16 UTC 2013] Image fetch done[Sat Mar 23 00:08:16 UTC 2013] tftp -JM binary -JG 192.168.1.55:jinstall-ex-4200-12.3R2.5-domestic-signed.tgz -JI vme[Sat Mar 23 00:09:10 UTC 2013] Received 111189814 bytes in 53.8 seconds[Sat Mar 23 00:09:10 UTC 2013] Image fetch done[Sat Mar 23 00:09:18 UTC 2013] /var/tmp/jinstall-ex-4200-12.3R2.5-domestic-signed.tgz is version 12.3R2.5.[Sat Mar 23 00:09:18 UTC 2013] This version is already installed.[Sat Mar 23 00:09:18 UTC 2013] Aborting install.[Sat Mar 23 00:09:18 UTC 2013] Removing /var/tmp/jinstall-ex-4200-12.3R2.5-domestic-signed.tgz[Sat Mar 23 00:09:19 UTC 2013] jinstall-ex-4200-12.3R2.5-domestic-signed.tgz not installed, committing config[Sat Mar 23 00:09:34 UTC 2013] Removing /var/run/image_load.pid
version 12.3R2.5; system { host-name ez_touch; root-authentication { encrypted-password "$ABC123"; ## SECRET-DATA } services { ssh; telnet; } syslog { user * { any emergency; } file messages { any notice; authorization info; } file interactive-commands { interactive-commands any; } } } interfaces { ge-0/0/0 { unit 0 { family ethernet-switching } } ge-0/0/1 { unit 0 { family ethernet-switching } } ge-0/0/2 { unit 0 { family ethernet-switching } } ge-0/0/3 { unit 0 { family ethernet-switching; } } ge-0/0/4 { unit 0 { family ethernet-switching; } } ge-0/0/5 { unit 0 { family ethernet-switching; } } ge-0/0/6 { unit 0 { family ethernet-switching; } } ge-0/0/7 { unit 0 { family ethernet-switching; } } ge-0/0/8 { unit 0 { family ethernet-switching; } } ge-0/0/9 { unit 0 { family ethernet-switching; } } ge-0/0/10 { unit 0 { family ethernet-switching; } } ge-0/0/11 { unit 0 { family ethernet-switching; } } ge-0/0/12 { unit 0 { family ethernet-switching; } } ge-0/0/13 { unit 0 { family ethernet-switching; } } ge-0/0/14 { unit 0 { family ethernet-switching; } } ge-0/0/15 { unit 0 { family ethernet-switching; } } ge-0/0/16 { unit 0 { family ethernet-switching; } } ge-0/0/17 { unit 0 { family ethernet-switching; } } ge-0/0/18 { unit 0 { family ethernet-switching; } } ge-0/0/19 { unit 0 { family ethernet-switching; } } ge-0/0/20 { unit 0 { family ethernet-switching; } } ge-0/0/21 { unit 0 { family ethernet-switching; } } ge-0/0/22 { unit 0 { family ethernet-switching; } } ge-0/0/23 { unit 0 { family ethernet-switching; } } ge-0/1/0 { unit 0 { family ethernet-switching; } } xe-0/1/0 { unit 0 { family ethernet-switching; } } ge-0/1/1 { unit 0 { family ethernet-switching; } } xe-0/1/1 { unit 0 { family ethernet-switching; } } ge-0/1/2 { unit 0 { family ethernet-switching; } } ge-0/1/3 { unit 0 { family ethernet-switching; } } } protocols { igmp-snooping { vlan all; } rstp; lldp { interface all; } lldp-med { interface all; } } ethernet-switching-options { storm-control { interface all; } } poe { interface all; }
root@ez_touch# run show log image_load_log|last[Sat Jan 26 03:56:44 UTC 2013] Directory to store image is valid /var/tmp[Sat Jan 26 03:56:45 UTC 2013] Creating file /var/tmp/jinstall-ex-4200-12.3R2.5-domestic-signed.tgz[Sat Jan 26 03:56:45 UTC 2013] tftp -JM binary -JG 192.168.1.55:test.conf -JI vme[Sat Jan 26 03:56:45 UTC 2013] Received 380 bytes in 0.0 seconds[Sat Jan 26 03:56:45 UTC 2013] Image fetch done[Sat Jan 26 03:56:45 UTC 2013] tftp -JM binary -JG 192.168.1.55:jinstall-ex-4200-12.3R2.5-domestic-signed.tgz -JI vme[Sat Jan 26 03:57:42 UTC 2013] Received 111189814 bytes in 56.1 seconds[Sat Jan 26 03:57:42 UTC 2013] Image fetch done[Sat Jan 26 03:57:50 UTC 2013] request system software add /var/tmp/jinstall-ex-4200-12.3R2.5-domestic-signed.tgz no-validate force[Sat Jan 26 03:58:13 UTC 2013]Checking pending install on fpc0fpc0:WARNING: A reboot is required to install the softwareWARNING: Use the 'request system reboot' command immediately[Sat Jan 26 03:58:13 UTC 2013] Image installation is done[Sat Jan 26 03:58:31 UTC 2013] Shutdown NOW![pid 2585][Sat Jan 26 03:58:31 UTC 2013] Removing /var/run/image_load.pid