Concepts
Clients and services
Section titled “Clients and services”The router knows two kinds of subscriber.
Services are the current model. A service is one customer, one ONT, one speed, one fixed
address and a permanent id (svc_xxxxxxxx). Your billing creates it with one call. The router
registers the ONT on the OLT and sets up everything on its own side. No MAC address is ever
needed: if the customer replaces the home router, the service keeps working with the same
address.
Clients are the older, MAC-based model. A client is a MAC address with a fixed IP on a VLAN you created. The MikroTik-compatible MK-api listener works with clients. Clients stay fully supported for networks that need them.
| Service | Client | |
|---|---|---|
| Identified by | ONT (port and ONT id, through Option 82) | MAC address |
| Created with | dtvsol service add, POST /services |
dtvsol clients add, MK-api |
| VLAN | one per PON port, created for you | one you create |
| Speed enforced by | the OLT (CAR) | the router (tc HTB) |
| Suspension | the ONT is deactivated on the OLT, and the address blocked | the address is blocked on the router |
One VLAN per PON port
Section titled “One VLAN per PON port”Every router has its own S-VLAN on each OLT. Inside it, every PON port has its own C-VLAN:
C-VLAN = 100 + card × 16 + ponPort 0/1/0 (card 1, PON 0) is VLAN 116. Port 0/0/3 is VLAN 103.
Each PON port gets its own /24 from the services’ IPv4 pool (svc_ipv4_pool in
/opt/dtvsol/etc/config.php), and its own /64 when IPv6 is set up:
port network = pool + (C-VLAN − 100) × 256 VLAN 100 → 100.64.0.0/24gateway = .1 VLAN 116 → 100.64.16.0/24ONT address = .2 + ONT id ONT 7 → 100.64.16.9On the router the port’s interface is named v<svlan>.<cvlan>, for example v1000.116. You
never allocate VLANs or addresses by hand: they follow from the OLT, the card, the port and the
ONT id.
Several operators’ routers can share one OLT. Each router has its own S-VLAN on it.
Option 82
Section titled “Option 82”When an ONT asks for an address, the OLT adds DHCP Option 82 to the request: which port and which ONT it came from. The router gives the ONT’s fixed address only to a request whose Option 82 names that ONT. This is why a service needs no MAC address.
See what the router receives:
dtvsol option82CGNAT port blocks
Section titled “CGNAT port blocks”Subscribers usually have private addresses (for example from 100.64.0.0/10). CGNAT sends them out through a small pool of public addresses.
The router’s CGNAT is deterministic. Each public address is divided into fixed port blocks
(2048 ports each by default, from ports 1024–65535). Each subscriber gets one block on one
public address and keeps it. Every assignment and release is written to
/opt/dtvsol/log/cgnat-mappings.log.
So there is no per-connection log to keep. To answer “who used XXX.XXX.XXX.70 port 40000 at that time”, look up the block:
dtvsol cgnat lookup XXX.XXX.XXX.70 40000See CGNAT.
Saved configuration and versions
Section titled “Saved configuration and versions”The whole configuration lives in one SQLite file, /opt/dtvsol/data/dtvsol.db. Clients,
services, VLANs, OLTs, plans, the network and the rest are documents in it. Every change is one
transaction.
Like a switch’s flash, you can keep versions:
dtvsol config save "before the new OLT"dtvsol config versionsdtvsol config diff 12 runningdtvsol config restore 12 --yesThe daily backup saves a version by itself when the configuration changed. Documents are never
edited by hand: use dtvsol config edit <name>, which checks the JSON and keeps a version first.
See Backup and restore.
The 120-second rollback
Section titled “The 120-second rollback”A change to the router’s own network (ports, bonds, addresses on them, the default route) can cut you off. So it is applied with a safety net:
- The netplan files are backed up and a configuration version is saved.
- The new file is checked with
netplan generate, then applied. - You have 120 seconds to confirm. Without a confirm, the old network is put back.
A change that would take away the address your SSH session, the API or the monitor uses is refused before anything runs.
dtvsol netcfg applydtvsol netcfg confirm # keep itdtvsol netcfg rollback # or put the old one back nowThe monitor’s Settings → Interfaces page works the same way. See Network changes.
This site was written with the help of AI and checked by our team.