Support Support Downloads Knowledge Base Case Manager My Juniper Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

Autoinstallation of Configuration Files on EX Series Switches using DHCP option 150

0

0

Article ID: KB27270 KB Last Updated: 25 Feb 2020Version: 3.0
Summary:
Autoinstallation is the automatic configuration of a device over the network from a pre-existing configuration file that you create and store on a configuration server—typically a Trivial File Transfer Protocol (TFTP) server. You can use autoinstallation to automatically configure new devices and to deploy multiple devices from a central location in the network.
Solution:
SETUP:

 
[EX4200-1] (Default Configuration)  ge-0/0/0 ---------- [EX4200-2]          (10.1.1.1)     (DHCP_SERVER)
                                                                ge-0/0/1 ---------- [TFTP server]      (10.1.1.25)
 
DHCP server configuration:
dhcp {
    boot-file auto_test.conf;
    option 150 ip-address 10.1.1.25;
    pool 10.1.1.0/24 {
        router {
            10.1.1.1;
        }
    }
}
 

Before you start make sure the switch configuration is zeroized - there are two options:


Option 1:
=======
[edit]
root@test-dnd# run start shell
root@test-dnd:RE:0% rm -rf /config/juniper*

Option 2:
=======
 
root> request system zeroize

root@test-dnd> request system reboot
Reboot the system ? [yes,no] (no) yes

warning: MD5File failed for /config/juniper.conf.gz

*** FINAL System shutdown message from root@test-dnd ***
System going down IMMEDIATELY


Shutdown NOW!
[pid 55724]
Nov 29 14:07:05 init: event-processing (PID 636) terminated by signal number 15!
Nov 29 14:07:05 init: event-processing (PID 55727) started

root@test-dnd> NWaiting (max 60 seconds) for system process `vnlru' to stop...done
Waiting (max 60 seconds) for system process `vnlru_mem' to stop...done
Waiting (max 300 seconds) for system process `bufdaemon' to stop...done
Waiting (max 300 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining...4 4 3 2 1 1 1 0 0 0 0 done

syncing disks... All buffers synced.
Uptime: 35d5h19m47s
recorded reboot as normal shutdown
Rebooting...


U-Boot 1.1.6 (Feb 6 2008 - 11:27:42)

Board: EX3200-24POE 2.7
EPLD: Version 6.0 (0x85)
DRAM: Initializing (512 MB)
FLASH: 8 MB
USB: scanning bus for devices... 2 USB Device(s) found
scanning bus for storage devices... 1 Storage Device(s) found

Consoles: U-Boot console
Found compatible API, ver. 7

FreeBSD/PowerPC U-Boot bootstrap loader, Revision 2.1
(marcelm@apg-bbuild01.juniper.net, Wed Feb 6 11:23:55 PST 2008)
Memory: 512MB
Loading /boot/defaults/loader.conf
/kernel data=0x8e55b8+0x950d0 syms=[0x4+0x7aab0+0x4+0xae2b8]


Hit [Enter] to boot immediately, or space bar for command prompt.
Booting [/kernel]...
Kernel entry at 0x800000e0 ...
GDB: no debug ports present
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1996-2011, Juniper Networks, Inc.
All rights reserved.
Copyright (c) 1992-2006 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
The Regents of the University of California. All rights reserved.
JUNOS 10.4R5.5 #0: 2011-06-14 03:40:39 UTC
builder@warth.juniper.net:/volume/build/junos/10.4/release/10.4R5.5/obj-powerpc/bsd/sys/compile/JUNIPER-EX
Timecounter "decrementer" frequency 37500000 Hz quality 0
cpu0: Freescale e500v2 core revision 2.2
cpu0: HID0 80004080<EMCP,TBEN,EN_MAS7_UPDATE>
real memory = 511705088 (488 MB)
avail memory = 500273152 (477 MB)
ETHERNET SOCKET BRIDGE initialising
Initializing EXSERIES platform properties ...
nexus0: <PPC e500 Nexus device>
ocpbus0: <on-chip peripheral bus> on nexus0
openpic0: <OpenPIC in on-chip peripheral bus> iomem 0xfef40000-0xfef600b3 on ocpbus0
memctl0: <mpc85xx memory error reporting> iomem 0xfef20000-0xfef20e5b,0xfef02000-0xfef02e5b irq 32,34 on ocpbus0
ECC not enabled to report errors 0xc3000000
device_attach: memctl0 attach returned 6
i2c0: <MPC85XX OnChip i2c Controller> iomem 0xfef03000-0xfef03014 irq 59 on ocpbus0
i2c1: <MPC85XX OnChip i2c Controller> iomem 0xfef03100-0xfef03114 irq 59 on ocpbus0
uart0: <16550 or compatible> iomem 0xfef04500-0xfef0450f irq 58 on ocpbus0
uart0: console (9600,n,8,1)
uart1: <16550 or compatible> iomem 0xfef04600-0xfef0460f irq 58 on ocpbus0
lbc0: <Freescale 8533 Local Bus Controller> iomem 0xfef05000-0xfef05fff,0xff000000-0xffffffff irq 22 on ocpbus0
cfi0: <AMD/Fujitsu - 8MB> iomem 0xff800000-0xffffffff on lbc0
syspld0 iomem 0xff000000-0xff00ffff on lbc0
tsec0: <eTSEC ethernet controller> iomem 0xfef24000-0xfef24fff irq 45,46,50 on ocpbus0
tsec0: hardware MAC address 00:19:e2:51:c7:7f
miibus0: <MII bus> on tsec0
e1000phy0: <Marvell 88E1112 Gigabit PHY> on miibus0
e1000phy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX, auto
pcib0: <Freescale MPC8544 PCI host controller> iomem 0xfef08000-0xfef08fff,0xf0000000-0xf3ffffff on ocpbus0
pci0: <PCI bus> on pcib0
pci0: <serial bus, USB> at device 18.0 (no driver attached)
ehci0: <Philips ISP156x USB 2.0 controller> mem 0xf0001000-0xf00010ff irq 22 at device 18.2 on pci0
usb0: EHCI version 1.0
usb0: <Philips ISP156x USB 2.0 controller> on ehci0
usb0: USB revision 2.0
uhub0: Philips EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
umass0: STMicroelectronics ST72682 High Speed Mode, rev 2.00/2.10, addr 2
pcib1: <Freescale MPC8544 PCI Express host controller> iomem 0xfef0a000-0xfef0afff,0xe0000000-0xe3ffffff,0xec000000-0xec0fffff irq 42 on ocpbus0
pci1: <PCI bus> on pcib1
pcib2: <PCI-PCI bridge> at device 0.0 on pci1
pci2: <PCI bus> on pcib2
mpfe0: <Juniper EX-series Packet Forwarding Engine> mem 0xa4000000-0xa40fffff,0xa0000000-0xa3ffffff irq 18 at device 0.0 on pci2
idma0: <mp85xxx DMA Controller> iomem 0xfef21000-0xfef21300 irq 36 on ocpbus0
Initializing product: 37 ..
bmeb: bmeb_lib_init done 0x81f0f800, addr 0x808e7bc4
bme0:Virtual BME driver initializing
Timecounters tick every 1.000 msec
Loading the NETPFE picpeer module
IPsec: Initialized Security Association Processing.
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <ST ST72682 2.10> Removable Direct Access SCSI-2 device
da0: 40.000MB/s transfers
da0: 1000MB (2048000 512 byte sectors: 64H 32S/T 1000C)
Trying to mount root from ufs:/dev/da0s1a
Attaching /packages/jbase via /dev/mdctl...
Mounted jbase package on /dev/md0...
Verified manifest signed by PackageProduction_10_4_0
Verified jboot signed by PackageProduction_10_4_0
Verified jbase-10.4R5.5 signed by PackageProduction_10_4_0
Mounted jcrypto-ex package on /dev/md1...
Verified manifest signed by PackageProduction_10_4_0
Verified jcrypto-ex-10.4R5.5 signed by PackageProduction_10_4_0
Mounted jdocs-ex package on /dev/md2...
Verified manifest signed by PackageProduction_10_4_0
Verified jdocs-ex-10.4R5.5 signed by PackageProduction_10_4_0
Mounted jkernel-ex package on /dev/md3...
Verified manifest signed by PackageProduction_10_4_0
Verified jkernel-ex-10.4R5.5 signed by PackageProduction_10_4_0
Mounted jpfe-ex42x package on /dev/md4...
Verified manifest signed by PackageProduction_10_4_0
Verified jpfe-ex42x-10.4R5.5 signed by PackageProduction_10_4_0
Mounted jroute-ex package on /dev/md5...
Verified manifest signed by PackageProduction_10_4_0
Verified jroute-ex-10.4R5.5 signed by PackageProduction_10_4_0
Mounted jswitch-ex package on /dev/md6...
Verified manifest signed by PackageProduction_10_4_0
Verified jswitch-ex-10.4R5.5 signed by PackageProduction_10_4_0
Mounted jweb-ex package on /dev/md7...
Verified manifest signed by PackageProduction_10_4_0
Verified jweb-ex-10.4R5.5 signed by PackageProduction_10_4_0
Executing /packages/mnt/jweb-ex-10.4R5.5/mount.post..
Automatic reboot in progress...
** /dev/da0s1a
FILE SYSTEM CLEAN; SKIPPING CHECKS
clean, 24656 free (48 frags, 3076 blocks, 0.1% fragmentation)
** /dev/da0s3e
FILE SYSTEM CLEAN; SKIPPING CHECKS
clean, 43201 free (249 frags, 5369 blocks, 0.4% fragmentation)
savecore: Router rebooting after a normal shutdown...
No dump exists
** /dev/da0s3d
FILE SYSTEM CLEAN; SKIPPING CHECKS
clean, 188791 free (23 frags, 23596 blocks, 0.0% fragmentation)
** /dev/da0s4d
FILE SYSTEM CLEAN; SKIPPING CHECKS
clean, 31643 free (27 frags, 3952 blocks, 0.1% fragmentation)
ln: /var/db/config: File exists
ln: /var/db/scripts: File exists
ln: /var/db/dcd.snmp_ix: File exists
ln: /var/db/snmp_engine.db: File exists
Creating initial configuration...mgd: error: Cannot open configuration file: /config/juniper.conf
mgd: warning: activating factory configuration
mgd: commit complete
mgd: ----------------------------------------------------------
mgd: Please login as 'root'. No password is required.
mgd: To start Initial Setup, type 'ezsetup' at the JUNOS prompt.
mgd: To start JUNOS CLI, type 'cli' at the JUNOS prompt.
mgd: ----------------------------------------------------------
Setting initial options: debugger_on_panic=NO debugger_on_break=NO.
Starting optional daemons: .
Doing initial network setup:.
Initial interface configuration:
additional daemons:.
Additional routing options:kern.module_path: /boot//kernel;/boot/modules ->Loading the NETPFE ethernet module
/boot//kernel;/boot/modules;/modules
grat_arpLoading common multilink module.
_on_ifup=YES: net.link.ether.inet.grat_arp_on_ifLoading the EX-series platform NETPFE module
up: 1 -> 1
kld netpfe drv: ifpfed_eth ifpfed_ml_cmnkld platform: ex_ifpfe if_vcpkern.module_path: /boot//kernel;/boot/modules;/modules -> /boot//kernel;/boot/modules;/modules;/modules/peertype
kld peertype: peertype_hcm peertype_pfem peertype_sfi peertype_slavere ipsec kld.
Doing additional network setup:.
Starting final network daemons:.
setting ldconfig path: /usr/lib /opt/lib
starting standard daemons: cron.
Local package initialization:.
kern.securelevel: -1 -> 1
starting local daemons:.
Tue Nov 29 14:08:59 UTC 2011
Boot media /dev/da0 has dual root support
** /dev/da0s2a
FILE SYSTEM CLEAN; SKIPPING CHECKS
clean, 14023 free (31 frags, 1749 blocks, 0.0% fragmentation)

test-dnd (ttyu0)

login: Nov 29 14:10:02 init: dhcp (PID 1235) started
Nov 29 14:10:02 init: autoinstallation (PID 1236) started               >>>> Make sure the autoinstallation PID gets started


Place the configuration file on the TFTP server at root:
  • file name :auto_test.conf

The EX Switch will boot and get an IP address in the offer packet, DHCP will send the TFTP server IP address (Option 150) and boot file name.
Once the EX Switch gets this information from DHCP it will try to fetch the conf file from the TFTP server as shown below





Output from the TFTP server where the file auto_test.conf is located.
You can see below that the Switch connects to the TFTP server to retrieve the file:



Login:root
Password:
root@wow_it_works:RE:0%
root@wow_it_works:RE:0% cli


root@wow_it_works> show configuration

## Last commit: 2011-11-29 14:13:08 UTC by root
version 10.4R5.5;
  system {
      host-name wow_it_works;
        root-authentication {
          encrypted-password "$ABC123"; ## SECRET-DATA
                          }
          syslog {
               user * {
                  any emergency;
                         }
         file messages {
              any notice;
                  authorization info;
                        }
        file interactive-commands {
              interactive-commands any;                   >>>>> switch pulled the configuration file <auto_test.conf> from TFTP server
                       }
            }
 }

Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search