cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
905
Views
0
Helpful
3
Replies

How to Move ip address from main interface to sub interface without losing connectivity? The device is in remote location

Dmohanty
Level 1
Level 1

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

3 Replies 3

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

 

 

cmarva
Level 4
Level 4

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.

Joseph W. Doherty
Hall of Fame
Hall of Fame
Unsure if it is possible to guarantee no loss of connectivity. You might only be able to minimize the loss to a fraction of a second.

If your remote session doesn't need to cross the interface being changed, just "pasting" the config changes might be sufficient. Perhaps to make the "paste" a bit faster, you can copy the config change into a file in flash, and then, copy that into the running config.

If your remote session crosses the interface being changed, the last suggestion, copying a flash file into the config, can be used for that too. Also in such a situation, first doing a scheduled reload, in a few minutes, at least should allow you to regain access to the device in your config changes to the device cause a problem with the interface you need.

BTW, I done changes like the last using remote telnet, while router has keep-alives active. Usually if you wait a few seconds, after pressing enter, your telnet session continues as it was.