EdgeRouter ER-X Firmware Bugs


2026-04-16

Ubiquiti’s EdgeOS firmware for the ER-X (MediaTek MT7621) ships with several scripts that carry bugs introduced by upstream Debian changes or endianness assumptions from the Cavium-based devices. These fixes are lost on firmware updates – reapply as needed.

DHCPv6-PD DUID Endianness

Setting a DHCPv6-PD DUID via:

1
set interfaces ethernet eth0 dhcpv6-pd duid 00:01:00:01:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

causes vyatta-dhcpdv6.service to fail on MediaTek devices. The symptom is the service stuck in a fail-restart loop:

1
2
3
4
5
6
7
# systemctl status vyatta-dhcpdv6.service
* vyatta-dhcpdv6.service - EdgeOS DHCPv6 Server
   Loaded: loaded (/lib/systemd/system/vyatta-dhcpdv6.service; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sun 2026-04-19 02:24:57 AEST; 1s ago
  Process: 15126 ExecStart=/usr/sbin/dhcpd3 -6 -pf $PIDFILE -cf $CONFIGFILE -lf $LEASEFILE (code=exited, status=1/FAILURE)
  Process: 15123 ExecStartPre=/bin/touch $LEASEFILE (code=exited, status=0/SUCCESS)
  Process: 15120 ExecStartPre=/bin/cp -u $LEASEFILEBAK $LEASEFILE (code=exited, status=0/SUCCESS)

The DUID file is written with a 16-bit big-endian length prefix, but the ER-X is little-endian.

File: /opt/vyatta/sbin/dhcpv6-pd-duid.pl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
--- /opt/vyatta/sbin/dhcpv6-pd-duid.pl.orig
+++ /opt/vyatta/sbin/dhcpv6-pd-duid.pl
@@ -41,7 +41,7 @@
     
    $duid =~ s/://g;
    my $len = length($duid) / 2;
-    my $buf = pack("n", $len);
+    my $buf = pack("S", $len);
    print $FH $buf || die "duid length write failed: $!\n";
 
    my $bin_duid = pack("H*", $duid);
@@ -57,7 +57,7 @@
     
    $duid =~ s/://g;
    my $len = length($duid);
-    my $buf = pack("n", $len);
+    my $buf = pack("S", $len);
    print $FH $buf || die "write failed\n";
 
    print $FH $duid;

After patching, force a full restart by committing a dummy change to cycle the daemon — the DUID file will be correctly regenerated as part of the commit:

1
2
3
4
5
6
configure
set interfaces ethernet eth0 dhcpv6-pd duid 00:01:00:01:xx:xx:xx:xx:xx:xx:xx:xx:xx:96
commit
set interfaces ethernet eth0 dhcpv6-pd duid 00:01:00:01:xx:xx:xx:xx:xx:xx:xx:xx:xx:95
commit
exit

ℹ️ Note

You can attempt regenerate the stale DUID file, but it’s not enough.

1
/opt/vyatta/sbin/dhcpv6-pd-duid.pl --action set --duid 00:01:00:01:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

References

SNMPv3 Commit Error

The SNMPv3 commit scripts reference the snmp system user, which has since been renamed to Debian-snmp in Debian. This causes a commit error when configuring SNMPv3.

File: /opt/vyatta/share/vyatta-cfg/templates/service/snmp/v3/node.def

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
--- node.orig.def
+++ node.def
@@ -17,7 +17,7 @@
     fi
     
 begin: if [ -d "/config/snmp/tls" ]; then
-    sudo chown -R snmp /config/snmp/tls;
+    sudo chown -R Debian-snmp /config/snmp/tls;
     sudo chmod -R 600 /config/snmp/tls;
   fi

References