08-14-2015 12:45 PM
Hi folks
First of all, I'm not a network guy, I'm a developer guy.
I'm trying to help my network guy with the following...
We have a Cisco 1921 router where G0/0 port is hooked up to a Comcast modem (primary line) which is assigned a single static IP address.
G0/1 port is hooked up to a wireless Raven X device powered by Sprint (backup line).
Idea is when Comcast goes down, all traffic goes to the G0/1 interface (Sprint).
However, it seems router can only switch traffic if physical G0/0 port is down which means unplugging the cable.
No matter if Comcast is really down, the Comcast modem will always be up on the G0/0 port.
So, I wonder if there is a way we could write a script to check if the assigned Comcast static IP address is reachable.
If it is not reachable, disable the G0/0 to force all traffic to go to the G0/1 interface.
When the Comcast IP is reachable, re-enable the G0/0 interface back.
Not sure if possible, but I think Cisco routers must be running a type of OS which allows some kind of programming and scheduling.
Thoughts?
Thanks for reading.
...Alex
Solved! Go to Solution.
08-16-2015 12:26 PM
This isn't entirely possible. While you can certainly test if a port is viable or not, once you disable it, how do you retest its viability?
One thing that could make this possible is to switch the default route. I can't imagine simply having an interface up when it doesn't have routes pointing out of it would disrupt traffic. In that case you could test the point-to-point connectivity out of that interface, then switch the default route back if the connectivity works.
08-17-2015 07:11 AM
Assuming your provider gives you IP address 10.1.1.2 and they have 10.1.1.1 on their end of the link, you pint 10.1.1.1 to test to see if the link is really up. This assumes that when it's not up that the ping would fail.
This use case is rather common and most use IP SLA to do the ping, then track the result with object tracking. EEM then reacts to the change in the object tracking state. I have an example of this in my CiscoLive automation deck at https://www.ciscolive.com/online/connect/sessionDetail.ww?SESSION_ID=78628&backBtn=true .
08-14-2015 05:21 PM
Alex,
Move this thread to the EEM section.
Your request is very common, in regards to EEM, and can be found in that section of the forum.
08-15-2015 07:08 AM
Leo,
Thanks for your response.
Post moved to EEM ;)
...Alex
08-16-2015 12:26 PM
This isn't entirely possible. While you can certainly test if a port is viable or not, once you disable it, how do you retest its viability?
One thing that could make this possible is to switch the default route. I can't imagine simply having an interface up when it doesn't have routes pointing out of it would disrupt traffic. In that case you could test the point-to-point connectivity out of that interface, then switch the default route back if the connectivity works.
08-16-2015 06:16 PM
Joseph,
Agree and it makes total sense, why disable the G0/0 interface when all I need is the traffic to out on G0/1 when G0/0 assigned static IP is not reachable and switch back when it is.
For me the logic to switch traffic between interfaces is whether the router is able to "reach" (ping) the assigned static IP address on the interface; however, you seem to refer to a certain "point to point connectivity" test, could you please elaborate on this particular test?
Also, do you mind giving me some script coding to illustrate how to code this script on the router
Thanks for your prompt response.
08-17-2015 07:11 AM
Assuming your provider gives you IP address 10.1.1.2 and they have 10.1.1.1 on their end of the link, you pint 10.1.1.1 to test to see if the link is really up. This assumes that when it's not up that the ping would fail.
This use case is rather common and most use IP SLA to do the ping, then track the result with object tracking. EEM then reacts to the change in the object tracking state. I have an example of this in my CiscoLive automation deck at https://www.ciscolive.com/online/connect/sessionDetail.ww?SESSION_ID=78628&backBtn=true .
08-18-2015 08:01 AM
Read up on tracking and ip SLA, your router will automaticlly switch to the other route and vise versa. No need for EEM for this.
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