07-10-2020 03:34 AM
How to Move ip address from main interface to sub interface in asr router without losing connectivity? Note- The device is in remote location with bgp routing
07-10-2020 04:36 AM
Hello,
you can't. You will lose conectivity, but the below procedure will save you a trip to the location, and after a reboot, the IP address will be active on the subinterface.
Let's say your original interface GigabitEthernet0/0 has IP address 192.168.1.1/24, and you want to move that IP address to subinterface GigabitEthernet0/0.10. Create the subinterface without the IP address, write the configuration to memory, configure the EEM script, and reload the router. When it comes back up, the IP address will be on the subinterface:
interface GigabitEthernet0/0
ip address 192.168.1.1 255.255.255.0
!
interface GigabitEthernet0/0.1
encapsulation dot1Q 10
--> wr mem
Configure this script:
event manager applet REBOOT_IP
event timer cron cron-entry "@reboot"
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "interface GigabitEthernet0/0"
action 4.0 cli command "no ip address"
action 5.0 cli command "exit"
action 6.0 cli command "interface GigabitEthernet0/0.1"
action 7.0 cli command "ip address 192.168.1.1 255.255.255.0"
action 8.0 cli command "end"
--> wr mem
--> reload
07-10-2020 04:54 AM
if you're looking to change the end-user facing interface, you can ssh to either the loopback IP of the router, or to the WAN IP (carrier facing interface) of the router. Then you can make the router changes. The part that is tricky will be the appropriate changes on the switch that is behind the router. That being said, and not knowing how the switch is configured, it's tough to say what would need changed.
07-11-2020 08:47 AM
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