Updated, entire network crashing (Draytek routers)

Hi @balloob

I re-enabled UPnP on my DrayTek and rebooted it, then commented out default_config and restarted everything… Unfortunately problem is still apparent…

Let me know if there is anything else you would like me to try…

Cheers… Andy.

2 Likes

I’m having the same issue here with a Draytek 2862ac running firmware 3.9.9_BT.

Took a bit of figuring out what was causing it before I discovered it was HA!

Managed to get up and running again by disabling the network to the Home Assistant VM and restoring backup via the console CLI.

I am also having problems using a standard haos build (32bit) on as Raspberry Pi 3b.
Unable to access anything on the network and had to pull the power unit out as PI was to hot to hold.
The router is a Draytek 2862.

Core 2023.6.2 has not fixed the problem either.

Is anyone actively looking at this issue?

I have a support ticket open with Draytek, but no response so far. I’m not sure if will help if others open duplicate requests reporting the same problem.

From using Wireshark to have a look what’s going on with HA 2023.6.2 running, I’m seeing SSDP messages from HA using IPv6 (everything else on my network is only using IPv4 for SSDP) eg

Simple Service Discovery Protocol
    M-SEARCH * HTTP/1.1\r\n
    HOST:[FF02::C%2]:1900\r\n
    MAN:"ssdp:discover"\r\n
    MX:4\r\n
    ST:ssdp:all\r\n
    \r\n
    [Full request URI: http://[FF02::C%2]:1900*]
    [HTTP request 1/10]
    [Next request in frame: 30221]

So I wonder if the problem is that Vigor routers can’t hope with UPnP over IPv6?

1 Like

I have removed from the default config the following
Cloud, media_source, mobile_app, my:, ssdp, and zeroconf.

The router is still crashing and has now downgraded itself to the last version due to the number of reboots.
I do not use ip6 on the network and have not seen any packets on wireshark.
The router only seems to send IGMPv2 packets but HA is sending IGMPv3, also IGMP group 239.255.255.250 is not showing in the routers table.

Hope this helps.

Please report the issue to Draytek, and don’t assume others have. It’s likely they haven’t received enough reports to prioritize fixing their firmware

Reported :slight_smile:

1 Like

Draytek have provided some test firmware for my 2862 - I now just need to find a time to load it and potentially break everything.
Meanwhile one of the reasons I was using UPnP was to monitor the router, I’ve now switched that to SNMP which gives much more data.

For those who might be interested, here’s what I’ve done with SNMP for the Vigor stats now I’ve got UPnP disabled.
Updated with a few more refinements since the original post.

########################################################
### Router Sensors in configuration.yaml
########################################################
sensor:
  # Router Sensors
  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.1.1.0
    name: snmp_draytek_info
    scan_interval: 60
    unique_id: "BazT5PE9Bumc"

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.1.3.0
    name: snmp_draytek_uptime
    scan_interval: 60
    value_template: >
      {% set time = value | int %}
      {% set minutes = ((time % 360000) / 6000) | int%}
      {% set hours = ((time % 8640000) / 360000) | int %}
      {% set days = (time / 8640000) | int %}
      {%- if time < 60 -%}
      {{ time }}s
      {%- else -%}
      {%- if days > 0 -%}
      {{ days }}d
      {%- endif -%}
      {%- if hours > 0 -%}
      {%- if days > 0 -%}
      {{ ' ' }}
      {%- endif -%}
      {{ hours }}hr
      {%- endif -%}
      {%- if minutes > 0 -%}
      {%- if days > 0 or hours > 0 -%}
      {{ ' ' }}
      {%- endif -%}
      {{ minutes }}min
      {%- endif -%}
      {%- endif -%}
    unique_id: "v7ZrMck96Cyh"

  - platform: snmp
    host: 192.168.1.1
    community: "public"
    version: "2c"
    baseoid: 1.3.6.1.4.1.7367.3.7.0
    name: snmp_draytek_memory
    unit_of_measurement: '%'
    scan_interval: 60
    unique_id: "Guk5vNot2bA7dK"

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.2.2.1.10.4
    name: snmp_vdsl_in
    device_class: data_size
    unit_of_measurement: 'bytes'
    scan_interval: 10

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.2.2.1.16.4
    name: snmp_vdsl_out
    device_class: data_size
    unit_of_measurement: 'bytes'
    scan_interval: 10

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.10.251.1.2.2.1.2.4.1
    name: snmp_vdsl_down_speed
    device_class: data_rate
    unit_of_measurement: 'Mb/s'
    value_template: "{{ value|int / 1000000 }}"
    scan_interval: 60
    unique_id: "Ftq5FDND4NkMUR"

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.10.251.1.2.2.1.2.4.2
    name: snmp_vdsl_up_speed
    device_class: data_rate
    unit_of_measurement: 'Mb/s'
    value_template: "{{ value|int / 1000000 }}"
    scan_interval: 60
    unique_id: "aqccVx8FXPmEjk"

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.2.2.1.8.4
    name: snmp_vdsl_status
    scan_interval: 60
    value_template: >
      {% if value | int == 1 %}
        Up
      {% else  %}
        Down
      {% endif %}

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.10.94.1.1.2.1.6.4
    name: snmp_vdsl_state
    scan_interval: 20
    unique_id: "RrVZCHS5u4NLXA"
    value_template: >
      {% set input = value %}
      {% set input = (input | regex_findall('.{1,2}') | list)[1:] | map('int', base=16) | map('pack', '>I') | map('string') | map('replace', "\\x00", "") | map('regex_findall', "b'([a-zA-Z]{1})'") | map('first') | select('defined') | join %}
      {{ input }}

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.10.94.1.1.3.1.4.4
    name: snmp_vdsl_snr_upstream
    device_class: signal_strength
    unit_of_measurement: "dB"
    scan_interval: 60
    unique_id: "DeanLB4rsasR6z"

  - platform: snmp
    host: 192.168.1.1
    community: 'public'
    version: "2c"
    baseoid: 1.3.6.1.2.1.10.94.1.1.2.1.4.4
    name: snmp_vdsl_snr_downstream
    device_class: signal_strength
    unit_of_measurement: "dB"
    scan_interval: 60
    unique_id: "CLcyVjyVd4cDMC"

  - platform: template
    sensors:
      internet_speed_in1:
        friendly_name: "Internet Speed VDSL In"
        device_class: data_rate
        value_template: "{{ min(((states.input_number.internet_traffic_delta_in1.state | float(default=0) ) / 1048576 ),states('sensor.snmp_vdsl_down_speed') | float(default=0) ) | round(3) }}"
        unit_of_measurement: "Mbit/s"
        unique_id: "mG9pjpuTmB"

      internet_speed_out1:
        friendly_name: "Internet Speed VDSL Out"
        device_class: data_rate
        value_template: "{{ min(((states.input_number.internet_traffic_delta_out1.state | float(default=0) ) / 1048576 ),states('sensor.snmp_vdsl_up_speed') | float(default=0) ) | round(3) }}"
        unit_of_measurement: "Mbit/s"
        unique_id: "gHK9FUVtvfhzw"

      draytek_model:
        friendly_name: "Draytek Model"
        value_template: >-
          {{ states.sensor.snmp_draytek_info.state.split(':')[1] | replace (', Version','') | trim }}
        unique_id: "3W9SWE8GKPnV"

      draytek_firmware:
        friendly_name: "Draytek Firmware"
        value_template: >-
          {{ states.sensor.snmp_draytek_info.state.split(',')[2].split(' ')[2] }}
        unique_id: "SSgP9ULmKjfx"

input_number:
  internet_traffic_delta_in1:
    name: "Traffic IN Delta 1"
    initial: 0
    min: 0
    max: 1000000000000

  internet_traffic_delta_out1:
    name: "Traffic OUT Delta 1"
    initial: 0
    min: 0
    max: 1000000000000


########################################################
### Router Automations in automations.yaml
########################################################
alias: Vigor - Monitor Internet Traffic In
description: ""
trigger:
  - platform: state
    entity_id: sensor.snmp_vdsl_in
action:
  - service: input_number.set_value
    data_template:
      entity_id: input_number.internet_traffic_delta_in1
      value: >-
        {{ max(((trigger.to_state.state  | int - trigger.from_state.state | int)
        * 8 ) / ( as_timestamp(trigger.to_state.last_changed) -
        as_timestamp(trigger.from_state.last_changed) ),0) }}

alias: Vigor - Monitor Internet Traffic Out
description: ""
trigger:
  - platform: state
    entity_id: sensor.snmp_vdsl_out
action:
  - service: input_number.set_value
    data_template:
      entity_id: input_number.internet_traffic_delta_out1
      value: >-
        {{ max(((trigger.to_state.state | int - trigger.from_state.state | int)
        * 8 ) / ( as_timestamp(trigger.to_state.last_changed) -
        as_timestamp(trigger.from_state.last_changed) ),0) }}
3 Likes

Thanks! I dabbled with SNMP and never got it working that might help!

Draytek have replied to my request:

"
Thank you for contacting technical support. Thank you for reporting this issue, I will be investigating and will get back to you as soon as I have a result.

Regards,
Gjok"

Reported to Draytek.
They seem to be aware: “This is a known issue when using UPnP combined with Home Assistant”

Running Vigor2862L
HA: Any release version ^2023.6.0

Draytek sent a beta-firmware: Version 20220615_STD
I re-enabled UPnP and disabled whatever hack I was trying with IGMP on the router (thanks for the suggestions though - was worth a try).
Also re-enabled UPnP/IGD in HA to pull statistics from router.

Have been running for 26 minutes now without issues.

1 Like

Running test firmware version 20220615_BT on a Vigor 2862 here and so far seems ok with UPnP enabled and HA 2023.6.2 running.

I only just updated to 2023.6.2 this afternoon, then spent an hour working out HA was the cause of my network continually crashing. Glad to find this thread and wonder if the Draytek test firmware for 2862 can be shared here for further testing? I’m unsure where else this could be downloaded from.

I am not sure I am more amazed by the number of people here with this router or the number of people who have upnp enabled. Is upnp not a security risk? Are there advantages with HA I am missing?

To be honest I hadn’t considered upnp a problem until now - but it affects all sorts of draytek routers. People buy them cos they’re rock solid. I’ve had two and neither has ever (till the HA update) ever crashed in many years of use…

I do not use this router but from what I have seen if you disable upnp, you may be good. I have also seen that there may be a router firmware update that clears up this issue.
Good Luck.

Hi all, I have noticed this same behaviour with virgin media and eero branded products. Connectivity is virgin router then eero mesh network configured as a router and Nat to the vm router.

Suddenly after updating this issue appeared. First thought it was the eeros but it seems to be it knocks off the whole system.

Is there a way to natively disable upnp and discovery from home assist as this seems to be flooding the network and eventually network kills itself with packets.

Thanks.

1 Like

I agree, can we have the facility to turn off these parts of HA causing these issues. That way we can still run our routers and other setups without this breaking our networks. That way we all have a choice to upgrade the router firmware it the companies are still supporting those models or turn off these settings in HA to continue using HA in an existing environment. I still believe this is the latest Matter inclusion causing this behaviour but like most people using HA, we already are using wifi, zigbee and/or zwave for devices and may not need to transition to Matter for a while, if at all.