configure two ports with identical IP address configuration

m4rtinm4rtin Member Posts: 170
I have a Cisco 1841 router with Fa0/0, Fa0/1 and Se0/0/0:0 interfaces. Fa0/0 is facing the LAN. At the moment WAN interface is Se0/0/0:0. It has following configuration:
interface Serial0/0/0:0
 ip address 10.10.10.165 255.255.255.254 secondary
 ip address 192.168.1.158 255.255.255.252
 encapsulation ppp
end

I would like to preconfigure interface Fa0/1 with the same parameters as the Serial0/0/0:0 has. Fa0/1 line protocol is down so it's not present in the routing table. The idea is to disconnect Serial0/0/0:0 and then connect Fa0/1. However, looks like IOS does not allow such operation:
C1841#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
C1841(config)#int Fa0/1
C1841(config-if)#ip address 10.10.10.165 255.255.255.254 secondary
% Warning: use /31 mask on non point-to-point interface cautiously
% 10.10.10.164 is assigned as a secondary address on Serial0/0/0:0
C1841(config-if)#ip address 10.10.10.158 255.255.255.252
% 10.10.10.156 overlaps with Serial0/0/0:0
C1841(config-if)#end
C1841#sh run int Fa0/1
Building configuration...

Current configuration : 73 bytes
!
interface FastEthernet0/1
 no ip address
 duplex auto
 speed auto
end

C1841#

As long as the line protocol of Fa0/1 is down it does not appear in routing table so there should be no conflict and technically this should be possible or am I missing something here? Is there a way/technique to configure two interfaces with identical IP address configuration while line protocol is up only one port at the time?

Comments

  • Forsaken_GAForsaken_GA Member Posts: 4,024
    Sure, put them in separate VRF's.

    Otherwise, no. IOS will not allow you to configure two interfaces in the same routing space with the same IP address.

    I assume this is a cutover scenario? If you have redundant links into the piece of gear, then just pre-wire the ethernet port. Then copy the relevant config from the serial port, default interface it, and apply it to the ethernet port and you're in business.

    If this is your only link in, and taking it down will cause you to lose connectivity because you're remote, you've got three options -

    #1 Have out of band access. I'm guessing you don't, otherwise this wouldn't be a problem

    #2 Have someone on site to perform the cutover at the console

    #3 FTP/TFTP/whatever a full config file with the changes you need up to the piece of gear, copy it to startup-config, reboot, and pray
  • networker050184networker050184 Mod Posts: 11,962 Mod
    EEM could take of it or a script ran from a device on the local LAN. I'd have a script make the change and then add a 'reload in' at the end so it will roll back if you can't get into the device.
    An expert is a man who has made all the mistakes which can be made.
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    EEM could take of it or a script ran from a device on the local LAN. I'd have a script make the change and then add a 'reload in' at the end so it will roll back if you can't get into the device.

    Ah, that's a good point, I didn't think about EEM. If the amount of downtime needs to be less than the routers boot cycle, that'd be a great way to do it.
  • ColbyGColbyG Member Posts: 1,264
    Should be able to have dupe IPs if one of the ports is shutdown. Not sure if that helps in this scenario.
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    ColbyG wrote: »
    Should be able to have dupe IPs if one of the ports is shutdown. Not sure if that helps in this scenario.

    Well, depends. You can't no shut it while the IP is duped and the other port is still up, but thinking about it, it'd be pretty easy to do an EEM script that, as soon as the line protocol on the serial goes down, shut the serial interface, and then no shut the ethernet interface. That would accomplish his goal of having the ports preconfigured and then taking down the serial circuit and plugging in the ethernet circuit results in the transfer of config from one port to the other.
  • m4rtinm4rtin Member Posts: 170
    #3 FTP/TFTP/whatever a full config file with the changes you need up to the piece of gear, copy it to startup-config, reboot, and pray

    I'll keep this as a plan-B in case EEM script doesn't work:)
    EEM could take of it or a script ran from a device on the local LAN. I'd have a script make the change and then add a 'reload in' at the end so it will roll back if you can't get into the device.

    I did following EEM script:
    event manager applet WAN_from_Serial0/0/0:0_to_Fa0/1 
     event syslog pattern ".*UPDOWN.*Serial0/0/0:0.* changed state to down"
     action 1.0 syslog msg "Interface Serial0/0/0:0 has gone down; configuring Serial0/0/0:0 and Fa0/1"
     action 10.0 cli command "end"
     action 2.0 cli command "enable"
     action 3.0 cli command "config t"
     action 4.0 cli command "default interface Serial0/0/0:0"
     action 5.0 cli command "int Fa0/1"
     action 6.0 cli command "no shut"
     action 7.0 cli command "ip address 10.10.10.158 255.255.255.252"
     action 8.0 cli command "ip address 10.10.10.165 255.255.255.254 secondary"
     action 9.0 cli command "logging event link-status"
    event manager applet WAN_from_Fa0/1_to_Serial0/0/0:0 
     event syslog pattern ".*UPDOWN.*FastEthernet0/1.* changed state to down"
     action 1.0 syslog msg "Interface FastEthernet0/1 has gone down; configuring Fa0/1 and Serial0/0/0:0"
     action 10.0 cli command "end"
     action 2.0 cli command "enable"
     action 3.0 cli command "config t"
     action 4.0 cli command "default interface FastEthernet0/1"
     action 5.0 cli command "int Serial0/0/0:0"
     action 6.0 cli command "no shut"
     action 7.0 cli command "ip address 10.10.10.158 255.255.255.252"
     action 8.0 cli command "ip address 10.10.10.165 255.255.255.254 secondary"
     action 9.0 cli command "logging event link-status"
    !
    end
    

    The "WAN_from_Fa0/1_to_Serial0/0/0:0" EEM applet is for rollback purposes- in case something goes wrong one can disconnect the Fa0/1 and Serial0/0/0:0 configuration is reapplied. Any other suggestions or corrections? Would you add "reload in 5" at the end of the script?
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    m4rtin wrote: »
    The "WAN_from_Fa0/1_to_Serial0/0/0:0" EEM applet is for rollback purposes- in case something goes wrong one can disconnect the Fa0/1 and Serial0/0/0:0 configuration is reapplied. Any other suggestions or corrections? Would you add "reload in 5" at the end of the script?

    Depends. Is someone going to be on site? If so, then no. If not, then absolutely.
  • m4rtinm4rtin Member Posts: 170
    I renamed the action labels to 1.0, 1.1, 1.2...2.0, 2.1, 2.2 etc. Otherwise the order of executed commands would have been wrong. Order of executed commands can be verified with "sh event manager policy registered" command.

    Depends. Is someone going to be on site? If so, then no. If not, then absolutely.

    No, there is nobody on the site. However, simple:
    action 2.2 cli command "reload in 5"
    

    ..will not work because one is asked confirmation about reloading and saving the running-config to startup-config. However, one could use "action <label> reload" with "ip sla". I mean for example like this(simplified example where reload is done after the first IP SLA failure):

    ip sla 10
     icmp-echo 10.10.10.165
     frequency 5
    ip sla schedule 10 life forever start-time now
    !
    track 10 ip sla 10 reachability
    !
    event manager applet test 
     event track 10 state down
     action 1 reload
    !
    

    This test was done on Cisco 7200 series router. My Cisco 1841 does not support "event track" option under EEM configuration. Is there a way for a workaround?
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    m4rtin wrote: »
    No, there is nobody on the site. However, simple:
    action 2.2 cli command "reload in 5"
    

    ..will not work because one is asked confirmation about reloading and saving the running-config to startup-config. However, one could use "action <label> reload" with "ip sla". I mean for example like this(simplified example where reload is done after the first IP SLA failure):


    Oh, well that's easy, just issues the reload in command manually before you do the cutover.
  • m4rtinm4rtin Member Posts: 170
    Oh, well that's easy, just issues the reload in command manually before you do the cutover.

    But just theoretically speaking, is it possible to reload the router using EEM if a certain host is not accessible and there is no "event track" option in the router?
  • Forsaken_GAForsaken_GA Member Posts: 4,024
    m4rtin wrote: »
    But just theoretically speaking, is it possible to reload the router using EEM if a certain host is not accessible and there is no "event track" option in the router?

    No idea. I'm sure it is, but you'd likely need to save the configuration first in order to avoid the prompt to save the config, and that may not always be desirable. I also tend to be more practical than theoretical, and practically speaking, you don't reboot network gear because something becomes unavailable.
  • m4rtinm4rtin Member Posts: 170
    No idea. I'm sure it is, but you'd likely need to save the configuration first in order to avoid the prompt to save the config, and that may not always be desirable.

    This should work :)
    !
    event manager applet reload-test
    event none
    action 0.1 cli command "enable"
    action 0.2 cli command "conf t"
    action 0.3 cli command "hostname R1"
    action 0.4 cli command "exit"
    action 1.0 cli command "reload in 1" pattern "yes"
    action 1.1 cli command "no" pattern "confirm"
    action 1.2 cli command "y"
    !
    
Sign In or Register to comment.