So I have found a way to do this that should work for almost all cisco 2950/60, 35xx etc models and firmwares.
You will need a box with DHCP and TFTP Server.
The cisco switch that needs to pull config obviously needs to be able to contact the DHCP Server, so vlan1 is probably where you want to be sure dhcp is passed out.
I am not going to go into detail with DHCP and TFTP configurations just let you know what you need to be aware of.
For my CentOS 6 distribution I needed to set the dhcpd options filename
and next-server
next-server
is specifying address of TFTP Server.
filename
is specifying configuration file you want cisco device to download which is on the TFTP server.
If there is no filename specified or if that file is not available, the switch will start asking for default configs, this will be different per switch/ap/router.
One of the files it asks for fx. is cisconet.cfg
If it cannot get data on the tftp address specified it will also try on 255.255.255.255 so it will ask on broadcast for a tftp server as well.
The files it requests can be seen if you have console access to the device.
Here is raw output after bootup on a Cisco 2960 switch where the filename specified is not available on the TFTP server so the switch will start asking for other files:
*Mar 1 00:02:18.621: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
*Mar 1 00:02:28.679: AUTOINSTALL: Vlan1 is assigned 10.10.100.13
*Mar 1 00:02:38.687: AUTOINSTALL: Obtain siaddr 10.10.100.1 (as config server)
*Mar 1 00:02:38.687: AUTOINSTALL: Obtain default router (opt 3) 10.10.100.1
%Error opening tftp://10.10.100.1/client_cfg.txt (Timed out)
%Error opening tftp://10.10.100.1/client_cfg.txt (Timed out)
%Error opening tftp://10.10.100.1/client_cfg.txt (Timed out)
%Error opening tftp://255.255.255.255/client_cfg.txt (Timed out)
%Error opening tftp://255.255.255.255/client_cfg.txt (Timed out)
%Error opening tftp://255.255.255.255/client_cfg.txt (Timed out)
%Error opening tftp://10.10.100.1/network-confg (Timed out)
%Error opening tftp://10.10.100.1/cisconet.cfg (Timed out)
%Error opening tftp://10.10.100.1/router-confg (Timed out)
%Error opening tftp://10.10.100.1/ciscortr.cfg (Timed out)
%Error opening tftp://10.10.100.1/network-confg (Timed out)
%Error opening tftp://10.10.100.1/cisconet.cfg (Timed out)
%Error opening tftp://10.10.100.1/router-confg (Timed out)
%Error opening tftp://10.10.100.1/ciscortr.cfg (Timed out)
%Error opening tftp://10.10.100.1/network-confg (Timed out)
%Error opening tftp://10.10.100.1/cisconet.cfg (Timed out)
%Error opening tftp://10.10.100.1/router-confg (Timed out)
%Error opening tftp://10.10.100.1/ciscortr.cfg (Timed out)
%Error opening tftp://255.255.255.255/network-confg (Timed out)
%Error opening tftp://255.255.255.255/cisconet.cfg (Timed out)
%Error opening tftp://255.255.255.255/router-confg (Timed out)
%Error opening tftp://255.255.255.255/ciscortr.cfg (Timed out)
%Error opening tftp://255.255.255.255/network-confg (Timed out)
%Error opening tftp://255.255.255.255/cisconet.cfg (Timed out)
Here is the output from a switch that receives the file correctly from TFTP:
*Mar 1 00:01:33.289: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
*Mar 1 00:01:43.674: AUTOINSTALL: Vlan1 is assigned 10.10.100.13
*Mar 1 00:01:53.674: AUTOINSTALL: Obtain siaddr 10.10.100.1 (as config server)
*Mar 1 00:01:53.674: AUTOINSTALL: Obtain default router (opt 3) 10.10.100.1
Loading client_cfg.txt from 10.10.100.1 (via Vlan1): !
[OK - 121 bytes]
*Mar 1 00:03:51.928: %SYS-5-CONFIG_I: Configured from tftp://10.10.100.1/client_cfg.txt by console
My configuration file is simple at the moment it basically allows telnet/www access with username/password cisco
enable password cisco
!
username cisco secret 0 cisco
!
line vty 0 4
password cisco
!
end
!
I could type copy running-config startup-config
before the end.
But if you just want this to run in running-config every time the switch starts your good to go.
If someone wanted they could make a do telnet "directorip" on a 3560 switch and check out what the director is replying.. i'm sure it's easy from there to actually create custom configs based on serial number of switch.
The TFTP and DHCP could be set up on a 2960 switch as well if you wanted to, there are guides for this on the interwebs.