Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 95 additions & 17 deletions ont/ont-tplink-xz000-g3.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,105 @@ parent: TP-Link

# Hardware Specifications

| | |
| ------------ | ------------------------------------- |
| Vendor/Brand | TP-Link |
| Model | XZ000-G3 |
| Chipset | EcoNet EN751221 |
| CPU | MIPS32 34Kc |
| Flash | 4 MB |
| RAM | 60792 kB |
| System | TCLinux |
| HSGMII | No |
| Optics | SC/APC |
| IP address | 192.168.1.1 |
| Web Gui | ✅ username `admin`, password `admin` |
| SSH | |
| Telnet | |
| Serial | |
| Form Factor | ONT |
| | |
| --------------- | ------------------------------------------------- |
| Vendor/Brand | TP-Link |
| Model | XZ000-G3 |
| Chipset | EcoNet EN751221 (PON PHY EN7571) |
| CPU | MIPS 34Kc, 700 MHz (4 threads) |
| Flash | 4 MB SPI NOR (EON EN25QH32B) |
| RAM | 64 MB DDR2 (60792 kB available) |
| System | TCLinux (Linux 2.6.36, BusyBox 1.26.2) |
| HSGMII | No |
| Ethernet | 1x 1 Gbit/s |
| Optics | SC/APC |
| IP address | 192.168.1.1 |
| Web Gui | ✅ username `admin`, password `admin` |
| SSH | |
| Telnet | ✅ port 23, limited TP-Link CLI (`/usr/bin/cli`) |
| Serial | ✅ |
| Serial baud | 115200 |
| Serial login | `admin` / `1234` |
| Form Factor | ONT |

<ImageFigure file="tp-link/xz000-g3-teardown.jpg" alt="TP-Link XZ000-G3 teardown" caption="TP-Link XZ000-G3: teardown (source: vantc.net)" />
<ImageFigure file="tp-link/xz000-g3-pcb-front.jpg" alt="TP-Link XZ000-G3 PCB front" caption="TP-Link XZ000-G3: PCB front, serial header TX/RX/GND/VCC on the top edge (source: vantc.net)" />
<ImageFigure file="tp-link/xz000-g3-pcb-back.jpg" alt="TP-Link XZ000-G3 PCB back" caption="TP-Link XZ000-G3: PCB back (source: vantc.net)" />

# Default GPON Identifiers

Values set by the firmware via OMCI at boot (from the boot log):

| | |
| ---------------- | ------------------------------------------------ |
| Vendor ID | TPLG |
| ONU-G Version | V4.0 |
| Equipment ID | TX-6610 |
| OMCC Version | 134 (0x86) |
| Software Version | `V3.1.4` (both images) |
| GPON SN | `TPLG` + last 4 bytes of the LAN MAC address |

If no valid serial number is stored in the `auth` / `hwinfo` flash areas, the firmware generates it automatically from the LAN MAC address (e.g. MAC `9C:A2:F4:3A:AD:DC` → SN `TPLGf43aaddc`).

## List of software versions

- `3.1.4 Build 220830 Rel.35191n` (HW version `2.0.0.1`, product ID `0x4685b102`)

# Serial

Connect a 3.3 V USB-TTL adapter to the `TX`, `RX` and `GND` pins of the header on the top edge of the PCB (leave `VCC` unconnected) and open the console at 115200 baud. The root console login is `admin` / `1234`.

<ImageFigure file="tp-link/xz000-g3-serial.jpg" alt="TP-Link XZ000-G3 serial connection" caption="TP-Link XZ000-G3: USB-TTL adapter connected to the serial header (source: vantc.net)" />

::: details TP-Link XZ000-G3 boot log
<<< ./serial_dump/tp-link-xz000-g3-bootlog.txt
:::

## Change the MAC address

From the serial shell the LAN MAC address (and therefore the auto-generated GPON SN) can be changed with:

```sh
macaddr <new_mac>
```

# Flash Layout

`cat /proc/mtd`

| dev | size | erasesize | name | flash offset |
| ---- | -------- | --------- | ------------- | ----------------------- |
| mtd0 | 00400000 | 00010000 | "flash" | `0x000000` - `0x400000` |
| mtd1 | 00020000 | 00010000 | "tcboot" | `0x000000` - `0x020000` |
| mtd2 | 00010000 | 00010000 | "romfile" | `0x020000` - `0x030000` |
| mtd3 | 00010000 | 00010000 | "factoryinfo" | `0x030000` - `0x040000` |
| mtd4 | 00010000 | 00010000 | "loid" | `0x040000` - `0x050000` |
| mtd5 | 00010000 | 00010000 | "hwinfo" | `0x050000` - `0x060000` |
| mtd6 | 00010000 | 00010000 | "config" | `0x060000` - `0x070000` |
| mtd7 | 00010000 | 00010000 | "iot" | `0x070000` - `0x080000` |
| mtd8 | 00130000 | 00010000 | "kernelA" | `0x080000` - `0x1b0000` |
| mtd9 | 00250000 | 00010000 | "rootfsA" | `0x1b0000` - `0x400000` |

`mtd0` covers the whole flash. The LAN MAC address is stored in `factoryinfo` (offset `0x30000`). There is only one firmware slot (`kernelA`/`rootfsA`), even if OMCI reports two images.

## Firmware dump

The whole flash can be dumped from the serial shell and sent to a TFTP server on the PC:

```sh
cat /dev/mtd0 > /tmp/mtd0
tftp -p -l /tmp/mtd0 -r mtd0 192.168.1.5 # replace with the IP of your TFTP server
```

A dump of all the partitions is available on [vantechcorner/XZ000-G3](https://github.com/vantechcorner/XZ000-G3/tree/main/firmware-dump).

# Known Bugs

The ONT randomly crashes when a PPPoE connection by a connected router is established.

The GPON serial sometimes temporarily disappears after a crash, preventing the ONT from reaching the O5 operational status.

# References

- [All about the TP-Link XZ000-G3 GPON ONT — vantc.net](https://vantc.net/all-about-the-tp-link-xz000-g3-gpon-ont.html) (photos, boot log and flash layout)
- [vantechcorner/XZ000-G3 firmware dump](https://github.com/vantechcorner/XZ000-G3/tree/main/firmware-dump)
152 changes: 152 additions & 0 deletions ont/ont-tplink-xz005-g6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
---
title: TP-Link XZ005-G6
has_children: false
parent: TP-Link
---

# Hardware Specifications

| | |
| --------------- | ------------------------------------------------------------ |
| Vendor/Brand | TP-Link |
| Model | XZ005-G6 (UN) V1.0 |
| Chipset | Realtek RTL9601D |
| CPU | MIPS, 300 MHz |
| Flash | 4 MB SPI NOR (XMC XM25QH32CHIG, 32 Mbit) |
| RAM | 32 MB DDR2 (embedded in the SoC) |
| System | Linux (Realtek SDK), U-Boot 2011.12.NA |
| 2.5GBaseT | Yes, 1x 2.5 Gbit/s (PHY Realtek RTL8221B) |
| Optics | SC/APC (laser driver / BOSA controller UX3320S) |
| Power | DC 9 V / 600 mA |
| IP address | 192.168.1.1 (`tplinkmodem.net`) |
| Web Gui | ✅ no default password (set on first access, see Web Access) |
| SSH | ❌ (can be enabled from the web UI, but returns an error) |
| Telnet | ✅ limited TP-Link CLI (see Telnet) |
| Serial | ✅ 4-pin header next to the `VCC` silkscreen (unpopulated) |
| Form Factor | ONT |

<ImageFigure file="tp-link/xz005-g6-pcb-front.jpg" alt="TP-Link XZ005-G6 PCB front" caption="TP-Link XZ005-G6 (UN) V1.0: PCB front (source: tripleoxygen.net)" />
<ImageFigure file="tp-link/xz005-g6-pcb-back.jpg" alt="TP-Link XZ005-G6 PCB back" caption="TP-Link XZ005-G6 (UN) V1.0: PCB back, XMC SPI NOR flash (source: tripleoxygen.net)" />

# Default GPON Identifiers

| | |
| ---------------- | --------------------------------------- |
| ONU Type | SFU (Ethernet UNI: 1, VEIP: 0) |
| Vendor ID | TPLG |
| Equipment ID | XZ005-G6 |
| Hardware Version | 1.0 |
| OMCC Version | 128 (0x80) |
| Software Version | `V0.1-3.0.0` (main), none (standby) |

The default GPON authentication parameters logged by the firmware are LOID `tplink`, password `tplink`.

## List of software versions

- `V0.1-3.0.0` (`softwareVersion 0.1.0 3.0.0 v6066.0 Build 231212 Rel.36338n`)

The stock firmware images are signed and verified both by the web upgrade and by the OMCI upgrade, so no custom firmware is available. Loading an unsigned image would require more invasive methods (e.g. via serial/U-Boot).

# Flash Layout

There is no root shell on the stock firmware, so the full `/proc/mtd` is not available yet. The following layout of the 4 MB SPI NOR flash is derived from the boot log (see below):

| Flash offset | Size | Content |
| ------------ | ------------- | -------------------------------------------------------------------------- |
| `0x000000` | | Preloader (Bismarck 3.5) + LZMA-compressed U-Boot (at `0x0179c0`, ~68 KB) |
| `0x040000` | `0x2000` (8 KB) | U-Boot environment |
| `0x042000` | `0x2000` (8 KB) | U-Boot environment (redundant copy) |
| `0x078000` | ~860 KB | Linux kernel (legacy uImage, LZMA, loaded from `0x94078000`) |
| ... | | Root filesystem |
| `mtd3` | | Configuration data, mounted on `/var/config` |

::: info Note
The SPI NOR flash is memory-mapped at `0x94000000` (and at `0x9fc00000` as boot vector), so the U-Boot `bootm 0x94078000` address corresponds to flash offset `0x78000`.
:::

The runtime configuration files are `/var/config/lastgood.xml` and `/var/config/lastgood_hs.xml`; factory defaults are `/etc/config_default.xml` and `/etc/config_default_hs.xml`. The BOSA calibration is read from `/var/config/rtkbosa_k.bin` (falling back to `/var/config/ux3320s_bob.conf`).

# Serial

The serial console is available on the unpopulated 4-pin header near the `VCC` silkscreen (right side of the PCB front). U-Boot shows `Hit any key to stop autoboot` with a 0 second timeout.

::: details TP-Link XZ005-G6 boot log
<<< ./serial_dump/tp-link-xz005-g6-bootlog.txt
:::

# Web Access

The device ships **without** default credentials: the password is chosen by the user on first access.

1. Factory reset by holding the rear reset button for a few seconds.
2. Open `http://192.168.1.1/superadmin` and set (and confirm) the **superadmin** password.
3. Open `http://192.168.1.1` to set the normal **user** password (log out from superadmin first if needed).

The superadmin account must be created **before** the normal user password, otherwise a factory reset is needed. Afterwards use:

- Normal user: `http://192.168.1.1`
- Superadmin: `http://192.168.1.1/superadmin`

The superadmin account unlocks a few extra web settings (enable SNMP, CWMP, SSH) and a higher-privilege CLI over Telnet.

## Enabling Telnet

Using "Inspect Element", you can see that the blocks for Telnet and SSH are set to `display: none`; you can make them visible. SSH does not work (it returns an error), but Telnet does; you just need to use a port other than 23, as that one is filtered (e.g. 2323). Before clicking "Save", open the browser console and enter:

```js
INCLUDE_WEB_TELNET = 1;
INCLUDE_SSH_ACCESS = 1; // SSH returns an error
```

Then click "Save" and log in via Telnet using the same superadmin password set in the GUI.

# Telnet

Telnet exposes TP-Link's own (limited) CLI, not a Linux shell. Once logged in, the following prompts are available:

```sh
TP-Link> # user EXEC
TP-Link# # privileged EXEC
TP-Link(conf)# # configuration mode
```

::: warning Note
Even the superadmin-level Telnet CLI is fairly restricted compared to a full shell.
:::

# Configuration backup (conf.bin) decryption

Several GPON/OMCI parameters have no web field but can be changed by exporting the configuration backup, editing it and importing it back.

The backup (`conf.bin`) is a compressed XML blob encrypted with **DES in ECB mode** (zero-padded to an 8-byte boundary), prefixed by a 16-byte MD5 digest of the compressed payload. Support for this exact model was merged into [`sta-c0000/tpconf_bin_xml`](https://github.com/sta-c0000/tpconf_bin_xml) ([PR #45](https://github.com/sta-c0000/tpconf_bin_xml/pull/45)), so the tool handles compression, hashing and encryption automatically:

```sh
# decrypt / unpack conf.bin to XML
python3 tpconf_bin_xml.py conf.bin conf.xml

# edit conf.xml, then pack it back
python3 tpconf_bin_xml.py conf.xml conf.bin
```

The DES key used for the `XZ005-G6 (UN) V1.0` is the 8-byte constant:

```
45 EE 92 32 CF 5B 1D FE
```

::: info Note
The product ID for this variant is `0x1c796e01` (readable at offset `0x34` of a same-format firmware update file).
:::

# Known limitations

The following OMCI fields are forced by the firmware and any user edit (including via config import) is ignored, so this device is not suitable when those fields need to be changed:

- Version of ME 256 `ONU-G` (hardware version)
- Version of ME 7 `Software image` (software version)

# References

- [TP-Link XZ005-G6 (UN) V1.0 — tripleoxygen wiki](https://www.tripleoxygen.net/wiki/ont/tplink/xz005-g6-un-v1) (photos and boot log, CC BY-NC-SA 4.0)
- [tpconf_bin_xml — configuration backup tool](https://github.com/sta-c0000/tpconf_bin_xml) ([PR #45](https://github.com/sta-c0000/tpconf_bin_xml/pull/45))
- [TP-Link XZ000-G3](/ont-tplink-xz000-g3) — related TP-Link ONT
Loading
Loading