Autoinstall - LAN
Autoinstall is a quite interesting topic, it deserves some labbing.
Start from the DOC-CD as usual, we focus on the LAN implementation first.
You can find HERE the flowchart of the autoinstall process.
This guide is quite clear too:
AutoInstall Using DHCP for LAN Interfaces
This is the topology we'll use:
R1 and R2 will start without configuration.
R3 is the DHCP server that provides TFTP informations to R1 and R2.
R4 acts as TFTP server that stores the configurations
First step: configure DHCP pool on R3:
ip dhcp pool R1 host 10.0.123.1 255.255.255.0 client-identifier 0063.6973.636f.2d63.3230.302e.3636.6262.2e30.3030.302d.4661.302f.30 option 150 ip 4.4.4.4 option 67 ascii R1-confg default-router 10.0.123.3
Do you prefer an easier client identifier? Read THIS blog post from Ivan Pepelnjak.
The pool defines a reserved IP address to be assigned to R1. We provide a default router and a couple of options. Option 150 defines a TFTP server, option 67 defines the filename do look for.
Second step: configure R4 as TFTP server
R4(config)#tftp-server flash:R1-confg
The config file for R1 is stored in R4's flash.
Now we erase the configuration on R1 and reload it:
R1#erase startup-config Erasing the nvram filesystem will remove all configuration files! Continue? [confirm] [confirm] [OK] Erase of nvram: complete R1#reload
R1 starts without a config file, requests an IP address via DHCP:
*Mar 1 00:00:29.735: AUTOINSTALL: FastEthernet0/0 is assigned 10.0.123.1
Together with the IP address, R1 gets some options, so it looks for the TFTP server 4.4.4.4:
*Mar 1 00:00:29.739: AUTOINSTALL: Obtain tftp server address (opt 150) 4.4.4.4
The option 67 informs R1 to download the config file R1-confg:
*Mar 1 00:00:49.291: %SYS-5-CONFIG_I: Configured from tftp://4.4.4.4/R1-confg by console
We can see the TFTP request on R4:
R4# Mar 2 23:20:14.226: TFTP: Looking for R1-confg Mar 2 23:20:14.230: TFTP: Opened flash:R1-confg, fd 0, size 1989 for process 244 Mar 2 23:20:14.374: TFTP: Finished flash:R1-confg, time 00:00:00 for process 244
This is the capture of the request coming from R1 to R4:
We can have the same result using option 66 "Server-Name" instead of option 150. We must provide a DNS server via DHCP.
Let's do it using R2 as DHCP client. Create DHCP pool on R3:
ip dhcp pool R2 host 10.0.123.2 255.255.255.0 client-identifier 0063.6973.636f.2d63.3230.312e.3636.6262.2e30.3030.302d.4661.302f.30 default-router 10.0.123.3 option 66 ascii tftp.ifconfig.it option 67 ascii R2-confg
We configure R3 as DNS server too:
R3(config)#ip host tftp.ifconfig.it 4.4.4.4 R3(config)#ip dns server
Now we can erase startup-config and reload R2.
On R2:
Translating "tftp.ifconfig.it"...domain server (255.255.255.255) [OK] Loading R2-confg from 4.4.4.4 (via FastEthernet0/0): ! [OK - 1923 bytes] *Mar 1 00:00:16.863: AUTOINSTALL: FastEthernet0/0 is assigned 10.0.123.2 *Mar 1 00:00:16.863: AUTOINSTALL: Obtain tftp server name tftp.ifconfig.itresolved to 4.4.4.4 *Mar 1 00:00:26.459: %SYS-5-CONFIG_I: Configured from tftp://tftp.ifconfig.it/R2-confg by console
On R4:
Mar 1 00:25:26.647: TFTP: Looking for R2-confg *Mar 1 00:25:26.651: TFTP: Opened flash:R2-confg, fd 0, size 1923 for process 245 *Mar 1 00:25:26.719: TFTP: Finished flash:R2-confg, time 00:00:00 for process 245
Everything worked as expected.
USEFUL LINKS
DHCP options are assigned by IANA, full list HERE.
How to use the mac address as client-id is explained HERE on ioshints blog. There're plenty of posts aboutDHCP.