Network Infrastructure & OpenWrt Homelab
Overview & The Journey
Honestly, I had never dabbled in networking much in the past. But recently I got quite pissed at my ISP (ekhm *cough* *cough* Orange), so I bought a router and flashed it with OpenWrt. I had so much fun with it and learned internet protocols so much better as a result, but I also lost a lot of nerves — I felt like a lost child at first! All I knew up until then was what an IP is, what a port is, and maybe how to set up basic firewall rules.
Getting the basic connection working took a few hours of research and action: learning what my ISP required, setting the WAN interface to VLAN 35, and establishing a PPPoE connection with the credentials provided by my ISP.
Took me around a few hours, but that wasn't the worst part. The real work went into IPTV, eliminating bufferbloat, and setting up WireGuard.
I made some mistakes, blew up connection few times, or made it really slow for some reason, or locked out myself of the internet by mistake with firewall rules, but in the end, if I were to do it again, since I already charted those waters it wouldn't be as dramatic. But absolutely the worst of it all was IPTV. It required special authentication, and I didn't even know at the time — I thought it would go over internet just like a normal connection. There was very little information on how to do it, and what I found was all outdated, often for different routers and contradicting each other. First I learnt to set up proxy and VLAN tags, that was the easy part... Authentication via some Sagemcom proprietary black magic on the other hand took a solid 7 days. At this point it was personal. I got angry and played whack-a-mole applying whatever I could find on the internet. I cloned the MAC to my router (turns out the ISP checks the router MAC to authenticate, which makes sense given that they lease the routers). That didn't work on its own. What finally worked was advice from a forum user: set vendorid to "sagemcom" and pass DHCP options via sendopts — Option 61 with my MAC address, and Option 77 set to FSVDSL_funbox.MLTV.softathome.Funbox6, but encoded in HEX! This was it. IPTV finally worked.
Technical Highlights
- WAN & PPPoE Connection: 802.1Q VLAN 35 tagged on WAN interface with ISP PPPoE credentials.
- IPTV & FunBox 6 Spoofing: Sagemcom vendor ID (
vendorid "sagemcom"), DHCPsendopts(Option 61 with cloned MAC, Option 77 in HEX), and IGMP proxy/snooping with a multicast querier. - Bufferbloat Mitigation (CAKE QoS): CAKE queue management with DSCP egress mapping to eliminate latency spikes while gaming with two active TV streams.
- Remote Access (WireGuard): WireGuard VPN tunnel on port 51820 routed via Cloudflare for encrypted mobile access to the homelab.
Przegląd projektu i droga pod górkę
Szczerze mówiąc, wcześniej niewiele miałem wspólnego z sieciami. Ostatnio jednak mocno wkurzyłem się na mojego dostawcę (Orange), więc kupiłem router i wgrałem OpenWrt. Miałem przy tym masę frajdy i świetnie poznałem protokoły internetowe, ale zjadłem też mnóstwo nerwów — na początku byłem jak dziecko we mgle! Jedyne co wiedziałem, to czym jest IP, port i może jak ustawić podstawowe reguły na firewallu.
Samo uruchomienie internetu zajęło parę godzin szukania: dowiedziałem się, czego wymaga ISP, ustawiłem interfejs WAN na VLAN 35 i zestawiłem połączenie PPPoE danymi logowania otrzymanymi od operatora.
Zeszło na to parę godzin, ale to nie była najgorsza część. Prawdziwa praca poszła w IPTV, eliminację bufferbloatu oraz WireGuarda.
Po drodze popełniłem masę błędów – parę razy uwaliłem połączenie, mocno je spowolniłem albo odciąłem się od sieci regułami firewalla. Gdybym miał to robić jeszcze raz, nie byłoby to już tak dramatyczne, bo przetarłem szlaki. Prawdziwym koszmarem okazała się jednak telewizja IPTV. Wymagała specjalnego uwierzytelnienia, o czym na początku nawet nie wiedziałem – myślałem, że pójdzie po prostu jak zwykły internet. W sieci było mało informacji, większość nieaktualna, pod inne modele routerów i wzajemnie sprzeczna. Samo postawienie proxy i tagów VLAN było prostą częścią... Uwierzytelnienie przez własnościową czarną magię Sagemcoma zajęło mi bitych 7 dni – to była już sprawa osobista. Zacząłem grać w ruletkę i testować wszystko, co znalazłem na forach. Sklonowałem adres MAC routera (operator sprawdza MAC wypożyczonego sprzętu), ale to samo w sobie nie wystarczyło. W końcu pomogła rada z forum: ustawienie vendorid na "sagemcom" oraz opcji DHCP przez sendopts – Opcja 61 z adresem MAC oraz Opcja 77 z wartością FSVDSL_funbox.MLTV.softathome.Funbox6 zakodowaną w HEX! I to było to. IPTV wreszcie ruszyło.
Kluczowe szczegóły techniczne
- Dostęp WAN i PPPoE: Tagowanie 802.1Q VLAN 35 na interfejsie WAN oraz autoryzacja PPPoE danymi od operatora.
- IPTV i spoofing FunBoxa 6: Identyfikator dostawcy
vendorid "sagemcom", DHCPsendopts(Opcja 61 ze sklonowanym adresem MAC, Opcja 77 w formacie HEX) oraz proxy IGMP i snooping z multicast querierem. - Eliminacja bufferbloatu (CAKE QoS): Algorytm kolejkowania CAKE z priorytetyzacją DSCP – brak skoków pingu w grach przy jednoczesnym działaniu 2 telewizorów.
- Zdalny dostęp (WireGuard): Tunel WireGuard na porcie 51820 spięty z Cloudflare do bezpiecznego połączenia z siecią domową z telefonu.