02-26-2016 10:12 AM
Looking for a way to setup a multi test approach for WAN/Internet Connections. Cisco 2921 ISR
Cell 0/2/0 - ATT
Cell 0/3/0 - VZW
Gig 0/0/0 - Lan
Gig 0/1/0 - Satellite
Gig 0/2/0 - Terrestrial (Fiber, DSL, Cable, etc)
This router sits in an emergency response vehicle. As the vehicle gets deployed in different areas it will have varying cell conditions and internet connections available to it.
With the Dual cell, I would like to setup a script that does the following.
Check Cell Signal on both carriers, pick the strongest signal. Proceed to Track/IP SLA.
Ping sourcing from interface, if line is up use route. If down, test other cell interface with lower signal, if up, use route.
EEM, accept sms commands, restrict to phone numbers on approved list. Text command “switch” to router, it will swap active cell connections, and reply with Current Cell status, and new cell status.
EEM, Text “Status” to router and respond with both current cell status and which is active.
If The terrestrial or Satellite connections are active, it will always use those over cell. Satellite will always have a UP/UP status as it is connected to the satellite modem, terrestrial will always be down unless connected to a connection. Terrestrial always trumps satellite.
Can someone help me write this?
Solved! Go to Solution.
02-27-2016 01:03 PM
EEM policy "commandoversms.tcl" in the above link can switch the cell carriers. SMS the router cli commands needed to make the switch. If your not tunneling the traffic then switching carriers can be destructive to connection oriented protocols. The wireless carrier will want all traffic sourced from the IP address of the associated cellular interface and if your not tunneling then NAT will have to be provisioned. When switching carriers the NAT table will have to be cleared and new connections initiated.
To simplify the policy I am assuming the static default routes have tracking statements and associated admin distance in the current running configuration.
Ip route 0.0.0.0 0.0.0.0 Terrestrial-next-hop-ip track 1
Ip route 0.0.0.0 0.0.0.0 sat-next-hop-ip 10 track 2
Ip route 0.0.0.0 0.0.0.0 cellular 0/3/0 20 track 3
Ip route 0.0.0.0 0.0.0.0 cellular 0/2/0 30 track 4
Default routing prefers VZW over ATT wireless using the static routes above. When ATT has a better signal the EEM policy below will place an admin distrance of 15 to the ATT interface. Likewise if current routing is using the ATT interface and VZW has a better signal EEM will make the ATT admin distance 30.
event manager applet dual_cell
event timer watchdog time 3600 maxrun 60
action 010 cli command "enable"
action 020 cli command "show cellular 0/2/0 radio | inc RSSI"
action 030 set attsignal "$_cli_result"
action 040 cli command "show cellular 0/3/0 radio | inc RSSI"
action 050 set vzwsignal "$_cli_result"
action 060 cli command "show ip route | inc 0.0.0.0"
action 070 regexp "(Cellular[0-9\/]+)" "$_cli_result" match currentinterface
action 080 if $_regexp_result eq "1"
action 090 regexp "RSSI = (-[0-9]+) dBm" "$attsignal" match attsignal
action 100 regexp "RSSI = (-[0-9]+) dBm" "$vzwsignal" match vzwsignal
action 110 if $vzwsignal gt "$attsignal"
action 120 if $currentinterface eq "Cellular0/2/0"
action 130 cli command "config terminal"
action 140 cli command "ip route 0.0.0.0 0.0.0.0 Cellular 0/2/0 30 track 4"
action 150 cli command "do clear ip nat tr *"
action 160 end
action 170 elseif $attsignal gt $vzwsignal
action 180 if $currentinterface eq "Cellular0/3/0"
action 190 cli command "config terminal"
action 200 cli command "ip route 0.0.0.0 0.0.0.0 Cellular 0/2/0 15 track 4"
action 210 cli command "do clear ip nat tr *"
action 220 end
action 230 end
action 240 end
02-26-2016 01:47 PM
Most of the requirements looks like a routing decision. Have an IPSLA preconfigured for all 4 transports then go down the list.
- See this link for issuing commands over SMS. Instead of Status command issue survey. Can also issue show command and get the return value, and issue IOS configuration commands.
https://supportforums.cisco.com/document/12316801/commands-over-sms
02-26-2016 01:47 PM
Thanks Daniel,
This makes sense to me. On the last wish on my list, can I have EEM switch the two cell carriers if I want them to via sms?
Cheers!
02-27-2016 01:03 PM
EEM policy "commandoversms.tcl" in the above link can switch the cell carriers. SMS the router cli commands needed to make the switch. If your not tunneling the traffic then switching carriers can be destructive to connection oriented protocols. The wireless carrier will want all traffic sourced from the IP address of the associated cellular interface and if your not tunneling then NAT will have to be provisioned. When switching carriers the NAT table will have to be cleared and new connections initiated.
To simplify the policy I am assuming the static default routes have tracking statements and associated admin distance in the current running configuration.
Ip route 0.0.0.0 0.0.0.0 Terrestrial-next-hop-ip track 1
Ip route 0.0.0.0 0.0.0.0 sat-next-hop-ip 10 track 2
Ip route 0.0.0.0 0.0.0.0 cellular 0/3/0 20 track 3
Ip route 0.0.0.0 0.0.0.0 cellular 0/2/0 30 track 4
Default routing prefers VZW over ATT wireless using the static routes above. When ATT has a better signal the EEM policy below will place an admin distrance of 15 to the ATT interface. Likewise if current routing is using the ATT interface and VZW has a better signal EEM will make the ATT admin distance 30.
event manager applet dual_cell
event timer watchdog time 3600 maxrun 60
action 010 cli command "enable"
action 020 cli command "show cellular 0/2/0 radio | inc RSSI"
action 030 set attsignal "$_cli_result"
action 040 cli command "show cellular 0/3/0 radio | inc RSSI"
action 050 set vzwsignal "$_cli_result"
action 060 cli command "show ip route | inc 0.0.0.0"
action 070 regexp "(Cellular[0-9\/]+)" "$_cli_result" match currentinterface
action 080 if $_regexp_result eq "1"
action 090 regexp "RSSI = (-[0-9]+) dBm" "$attsignal" match attsignal
action 100 regexp "RSSI = (-[0-9]+) dBm" "$vzwsignal" match vzwsignal
action 110 if $vzwsignal gt "$attsignal"
action 120 if $currentinterface eq "Cellular0/2/0"
action 130 cli command "config terminal"
action 140 cli command "ip route 0.0.0.0 0.0.0.0 Cellular 0/2/0 30 track 4"
action 150 cli command "do clear ip nat tr *"
action 160 end
action 170 elseif $attsignal gt $vzwsignal
action 180 if $currentinterface eq "Cellular0/3/0"
action 190 cli command "config terminal"
action 200 cli command "ip route 0.0.0.0 0.0.0.0 Cellular 0/2/0 15 track 4"
action 210 cli command "do clear ip nat tr *"
action 220 end
action 230 end
action 240 end
09-07-2017 07:05 AM - edited 09-07-2017 07:18 AM
Good Morning.
Hoping someone here can help..
We've recently received a new version of the Cisco 819 Router.
IOS Version: c800-universalk9-mz.SPA.156-3.M0a.bin
Hardware: C819G-LTE-MNA-K9 (revision 6.0)
Running the commandoversms.tcl script crashes this router... I've tried it on several of them.. No matter what sms text I send to the device, it immediately crashes and reboots..
Has anyone else had this experience or heard of this?
Is this script not for use on this specific platform, as it worked with our former devices:
C819G-4G-A-K9
c800-universalk9-mz.SPA.154-3.M6a.bin
Thanks in advance!
11-22-2017 08:28 AM
Im using the script with 15.6(3)M3a. No crashing issues
11-22-2017 08:50 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