10-29-2008 07:58 AM - edited 03-15-2019 02:13 PM
we need to change the IP address of our VLAN, and I configured the new IP address as secondary IP address,now I want to improve the secondary address as the primary and delete the old ones,how to do that ?
Thank you!
Solved! Go to Solution.
11-04-2008 07:02 AM
Try these commands:
no ip address
ip address
ip address
11-04-2008 07:02 AM
Try these commands:
no ip address
ip address
ip address
11-10-2008 11:05 PM
Tahnk you very much for your help!
07-22-2015 05:57 PM
This is just a further cosmetic explanation of earlier provided correct answer.
no ip address <ip address1, subnet mask1> secondary
ip address <ip address1, subnet mask1>
! it ll overwrite the existing primary ip address.
ip address <ip address2, subnet mask2> secondary
End Reslt
-------------
IP Address 1 became primary and 2 became secondary
02-13-2020 06:25 PM - edited 02-13-2020 06:33 PM
If you only have a single mgmt interface, you may be able to swap them by combining both commands on a single line joined with ';' (semicolon).
e.g. current config:
interface mgmt0
ip address 192.168.1.1/24
ip address 10.10.10.1/24 secondary
NOTE: for safety, run from console or connected in via a different VLAN SVI IP if possible... :)
Steps required:
1) Remove current secondary IP (not allowed to have main or secondary IPs conflict/duplicated)
2) Replace current IP with old secondary IP
3) add old IP as secondary IP
Combine all 3 commands into a single command joined with ';' (semicolon), e.g.:
no ip address 10.10.10.1/24 secondary ; ip address 10.10.10.1/24 ; ip address 192.168.1.1/24 secondary
Resulting config:
interface mgmt0
ip address 10.10.10.1/24
ip address 192.168.1.1/24 secondary
I looked into using configuration session/commit, but this does not support interface IP change.
Brian
08-19-2022 11:01 AM - edited 08-19-2022 11:03 AM
@SiliconBrian are you sure about the need to remove secondary IP before adding it as primary? I lab'd it up in EVE-NG and was able to apply the secondary as primary in one command. Running - ip address 10.10.10.1 255.255.255.0, made it primary and removed secondary even though 10.10.10.1 was currently set as secondary.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide