MacTelnet, .NET, and AiStudio

How a long‑standing problem finally cracked — with help from modern AI

In my many years working on Primanet, I’ve built a lot of networking tools.
When few people serve many customers, automation stops being a luxury and becomes survival. Over time you naturally accumulate a toolbox for provisioning, troubleshooting, and remote operations.

One recurring need was MacTelnet.

Anyone who works with MikroTik uses it daily.
It’s a small but incredibly useful protocol: it lets you reach a router even when you’re not on the same subnet. For a WISP, that’s gold.

But every time I tried to bring MacTelnet into the .NET world, I failed.

  • Too little protocol documentation
  • A very tricky authentication algorithm
  • Several attempts over the years — all dead ends

I had tried three or four times. Never got it working.


AiStudio enters the picture

Today I’m extending AiStudio’s capabilities — using AiStudio itself.
A while ago I added SSH as a tool for the AI, and that made me think again about MacTelnet.

Imagine being able to ask AiStudio:

  • “Troubleshoot this router.”
  • “Provision these 20 home routers.”
  • “Move this configuration to...”

To do that, AiStudio would need MacTelnet.

AiStudio has a very strong deep‑research capability, so I let it loose on the problem.
As expected, the beginning was rough.
But AiStudio doesn’t get tired. It doesn’t lose patience. It keeps digging.

At some point, it started to look like we were getting somewhere.
I had something that resembled a design manual.


Building the proof of concept

I added a small test router to my local network and switched to the Programmer domain of AiStudio.

We quickly scaffolded a clean .NET 10 solution.
We prepared a test harness for iterative work.
Then I gave AiStudio a simple target:

“Iterate until you achieve AuthComplete.”

Watching AiStudio work with this task was genuinely impressive.
It added one layer at a time, tested, analyzed, corrected, and tried again.
My own understanding of low‑level duplex UDP and “escrowed encryption” is limited — this is not my natural territory — but AiStudio kept pushing.

After a couple of days, the nut cracked.
I had a working proof‑of‑concept.

And the moment it connected, the terminal produced the familiar RouterOS banner — a small but very satisfying milestone:

  MMM      MMM       KKK                          TTTTTTTTTTT      KKK
  MMMM    MMMM       KKK                          TTTTTTTTTTT      KKK
  MMM MMMM MMM  III  KKK  KKK  RRRRRR     OOOOOO      TTT     III  KKK  KKK
  MMM  MM  MMM  III  KKKKK     RRR  RRR  OOO  OOO     TTT     III  KKKKK
  MMM      MMM  III  KKK KKK   RRRRRR    OOO  OOO     TTT     III  KKK KKK
  MMM      MMM  III  KKK  KKK  RRR  RRR   OOOOOO      TTT     III  KKK  KKK

  MikroTik RouterOS 7.x (c) 1999–2026       https://www.mikrotik.com/

[admin@test-router] > _

A small banner — but a big moment.

The GitHub version is cleaner and more polished, but the core breakthrough happened right there.


Thanks where it’s due

I want to thank Håkon Nessjøen.
His work was an important source of inspiration.
Without it, this would have been much harder.


The result

The result of this work is now published as:

KC.MacTelnet — a modern .NET 10 implementation of the MacTelnet protocol,
with a pluggable terminal engine and clean RouterOS 7.x support.

It’s a reference implementation — something others can build on, learn from, or adapt.

Repo on Github

Release


A note on expectations

I’m releasing this because I believe it will be useful to others.
But I want to set expectations clearly:

  • I am not running an active support channel
  • I may not respond quickly (or at all) to issues or feature requests
  • Contributions are welcome, but development will not be fast or continuous

Think of this as a solid foundation, not a product with a roadmap.