Retaining VLAN-1 IP addressing across configuration file downloads
Enabling IP preserve to retain VLAN-1 IP addressing
IP Preserve retains VLAN-1 IP addressing across configuration file downloads.
To set up IP Preserve, insert the “ip preserve“ at the end of a configuration file, as shown in the following example. Note that you do not execute IP Preserve by entering a command in the CLI.
Operating rules for IP preserve
When ip preserve
is entered
as the last line in a configuration file stored on a TFTP server:
If the switch’s current IP address for VLAN 1 was not configured by DHCP/ Bootp, IP Preserve retains the switch’s current IP address, subnet mask, and IP gateway address when the switch downloads the file and reboots. The switch adopts all other configuration parameters in the configuration file into the startup-config file.
If the switch’s current IP addressing for VLAN 1 is from a DHCP server, IP Preserve is suspended. In this case, whatever IP addressing the configuration file specifies is implemented when the switch downloads the file and reboots. If the file includes DHCP/Bootp as the IP addressing source for VLAN 1, the switch will configure itself accordingly and use DHCP/ Bootp. If instead, the file includes a dedicated IP address and subnet mask for VLAN 1 and a specific gateway IP address, then the switch will implement these settings in the startup-config file.
The
ip preserve
statement does not appear inshow config
listings. To verify IP Preserve in a configuration file, open the file in a text editor and view the last line.
Overview of IP preserve
For the switches covered in this guide, IP Preserve enables you to copy a configuration file to multiple switches while retaining the individual IP address and subnet mask on VLAN 1 in each switch, and the Gateway IP address assigned to the switch. This enables you to distribute the same configuration file to multiple switches without overwriting their individual IP addresses.
To summarize the IP Preserve effect on IP addressing:
If the switch received its most recent VLAN 1 IP addressing from a DHCP/ Bootp server, it ignores the ip preserve command when it downloads the configuration file, and implements whatever IP addressing instructions are in the configuration file.
If the switch did not receive its most recent VLAN 1 IP addressing from a DHCP/Bootp server, it retains its current IP addressing when it downloads the configuration file.
The content of the downloaded configuration file determines the IP addresses and subnet masks for other VLANs.
The following examples demonstrate the operation of IP Preserve:
If you apply the following configuration file to the scenario that is shown in Example of IP Preserve operation with multiple series switches, switches 1 - 3 will retain their manually assigned IP addressing and switch 4 will be configured to acquire its IP addressing from a DHCP server.
Configuration file in TFTP server with DHCP/Bootp specified as the IP addressing source
switch(config)# show run Running configuration: ; J9091A Configuration Editor; Created on release #K.15.10.0001 hostname "switch" module 1 type J8702A module 2 type J8705A trunk A11-A12 Trk1 Trunk ip default-gateway 10.10.10.115 snmp-server community "public" Unrestricted vlan 1 name "DEFAULT_VLAN" untagged A1-A10,A13-A24,B1-B24,Trk1 ip address dhcp-bootp exit spanning-tree Trk1 priority 4 password manager password operator
If you apply the following configuration file to the scenario that is shown in Example of IP Preserve operation with multiple series switches, switches 1 - 3 will still retain their manually assigned IP addressing. However, switch 4 will be configured with the IP addressing included in the file.
Configuration file in TFTP server with dedicated IP addressing, instead of DHCP/Bootp
switch# show run Running configuration: ; J9091A Configuration Editor; Created on release #K.15.10.0001 hostname "switch" module 1 type J8702A module 2 type J8705A trunk A11-A12 Trk1 Trunk ip default-gateway 10.10.10.115 snmp-server community "public" Unrestricted vlan 1 name "DEFAULT_VLAN" untagged A1,A7-A10,A13-A24,B1-B24,Trk1 ip address 10.12.17.175 255.255.255.0 tagged A4-A6 no untagged A2-A3 exit vlan 2 name "VLAN2" untagged A2-A3 no ip address exit spanning-tree Trk1 priority 4 password manager password operator