We have alot of Cisco 800 Series routers and the same issue. I create a TCL script that i scheduled on the router to run, so it would read out the xDSL synched upload bandwidth and configure the policy map accordingly. Here is the script:
# Create empty variables because TCLshell is not very bright
set errlevel 0
# Set the amount of percentage that the upload is utilizing from the total bandwidth
# Internal bandidth analisation of multiple branches have shown that currently (june 2020) about 22% of the bandidth is used for uploads
set uploadpercent 22
# Gets the hostname of the device
set rohostname [lindex [exec "show running-config | include ^hostname"] 1]
# Gets the current speed
set currentspeed [lindex [exec "show policy-map QOS_OUT | include cir"] 1]
# Gets the model of the router
set getModel [exec "show running-config | include license"]
if {[lindex $getModel 3] == "C892FSP-K9"} {
# We assume a bandwidth of at least 100Mbit/s and will configure a corresponding bandwidth of 80Mbit/s (80%)
set newspeed [expr 800000 * $uploadpercent]
# We calculate what amount of this speed falls to upload, as only the upload is limited
} elseif {[lindex $getModel 3] == "C897VA-K9"} {
# Checking, if VDSL is synchronized
set VDSLSTATUS [exec "show controllers vDSL 0 | include Modem Status:"]
if {[regexp {TC\sSync} $VDSLSTATUS]} {
set vdslupspeed [lindex [exec "show controllers vDSL 0 | include ^Speed"] 5]
set kbitfilling "000"
set newspeed [expr $vdslupspeed$kbitfilling / 100 *80]
} else {
# VDSL link is currently down, so there is no way to read the synched speed
set errlevel 1
set errdescription "VDSL Link down"
}
} else {
set errlevel 1
set errdescription "Unsupported model"
}
# Check if there is a speed difference and configure new speed
if {$errlevel == 0} {
if {$newspeed != $currentspeed} {
ios_config "policy-map QOS_OUT" "class class-default" "shape average $newspeed"
exec "write"
}
}
# Create human understandable speeds
if {$errlevel == 0} {
set currentspeedhuman [expr $currentspeed /1000]
if {[string length $currentspeedhuman] >= 4} {
set currentspeedhuman "[string range $currentspeedhuman 0 end-3]'[string range $currentspeedhuman end-2 end]"
}
set newspeedhuman [expr $newspeed /1000]
if {[string length $newspeedhuman] >= 4} {
set newspeedhuman "[string range $newspeedhuman 0 end-3]'[string range $newspeedhuman end-2 end]"
}
}
# Report back to Splunk
if {$errlevel == 0} {
if {$newspeed == $currentspeed} {
puts "The speed of the QoS policy remains unchanged at $newspeedhuman Kbit/s"
[exec "send log facility MANAGEMENT severity 6 mnemonics LOG The speed of the QoS policy remains unchanged at $newspeedhuman Kbit/s"]
} else {
puts "The speed of the QoS policy has been adjusted from $currentspeedhuman Kbit/s to $newspeedhuman Kbit/s"
[exec "send log facility MANAGEMENT severity 6 mnemonics LOG The speed of the QoS policy has been adjusted from $currentspeedhuman Kbit/s to $newspeedhuman Kbit/s"]
}
} else {
puts "The script encountered an issue and did not change anything. Error description: $errdescription"
[exec "send log facility MANAGEMENT severity 6 mnemonics LOG he script encountered an issue and did not change anything. Error description: $errdescription"]
}
You would need to adjust the values for your devices and configuration of course. You can then create a EEM applet, that runs the script on a weekly basis:
event manager applet SETQOSBANDWIDTH
event timer cron cron-entry "0 3 * * 1"
action 1.0 cli command "enable"
action 2.0 cli command "tclsh flash:qosbandwidth.tcl"
action 3.0 syslog priority informational msg "CronJob for setting QoS bandwidth ran successful" facility "MANAGEMENT"
sho dsl int
will show it. Plus, the rate at which it trained is not necessarily the rate currently available -- bin usage is adaptive. The only thing I can think of would be some complicated EEM setup. (I don't have DSL anymore, so I couldn't test anything. My sync rate was always higher than provisioned/usable rate.)