Plus minus
Strona domowa Ireny i Zbigniewa Kuleszów
Serdecznie witamy na domowych, prywatnych serwerach
Dzisiaj jest: 2026-06-23  Aktualizacja strony dnia: [an error occurred while processing this directive]
Jezyki
Rocznica 24 lat pracy serwerów i strony zjk.pl :-) (od 2002)
24 lat nieprzerwanej pracy z systemem FreeBSD / 24 years of continuous work with FreeBSD
system
UWAGA! Ten serwis, strona i podstrony mogą używać cookies i podobnych technologii (brak zmiany ustawienia przeglądarki oznacza zgodę na to)!
Powitanie Autor Irena Zbigniew Elektronika Studenci Serwer Prawo_jazdy Kolejka Pobierz Linki Palmtop Kontakt Info O Tobie Mail
FreeBSD i mikroserwery. Rocznica 18 lat pracy serwerów i strony zjk.pl :-) Nieprzerwanie od 2002 roku.
Info ogólne Infrastruktura Kogo goœcimy? Usługi Sprzęt Technologie FreeBSD Oprogramowanie Aktualizacje Historia Pobierz Linki Kontakt CMS Blog Dla_Róży Mail Zbyszek
Zdjęcia 1 Zdjęcia noc 1 Zasilanie HA-OPNsense PCI riser i9 9900T Chłodzenie Zrobię samemu 32do64 FAQ Aktualizacje 32do64 Zrobię samemu Pobierz Linki Kontakt CMS Blog Dla_Róży
Przypadki Testy odpornoœci Manifest Opinie AI Logi Poczta Mail Zbyszek



**
**Tu spis   Tu spis**
**

PL  Tekst

Studia przypadków


Przypadek 1: getty


Studium Przypadku (Case Study): Jak jedna linia w rc.conf sparaliżowała FreeBSD i zmyliła diagnostykę systemu 
Wstęp i kontekst środowiska
1. Objawy awarii (Symptomy pierwotne)

Po restarcie maszyny system nie potrafił przejść do normalnego trybu wielozadaniowego (Multi-User) i wpadał w pętlę krytycznych błędów konsoli tekstowej:

  1. Pętla Getty: Ekran był masowo zalewany komunikatem:
    init: cant exec getty /usr/libexec/getty for port /dev/ttyv0: no such file or directory
    a następnie:
    getty repeating too quickly on port ttyv0, sleeping 30 secs.
    Objaw ten dotyczył wszystkich konsol wirtualnych od ttyv0 do ttyv7.
  2. Awaria trybu awaryjnego (Single-User Mode): Próba wejścia do trybu jednoosobowego w celu naprawy konfiguracji kończyła się powtarzającym komunikatem:
    cannot read termcap database.
    Uniemożliwiało to poprawne działanie standardowych powłok tekstowych i zaawansowanych edytorów (np. vi), wymuszając pracę w trybie terminala dump.
  3. Status "Amnesiac": W rzadkich momentach, gdy system pozwalał na interakcję w trybie Multi-User, zgłaszał się pod domyślną nazwą jądra: amnesiac. Całkowicie brakowało dostępu do programu /usr/bin/login, a interfejsy sieciowe oraz kontenery jail pozostawały nieaktywne.
2. Chronologia diagnostyki i ślepe zaułki (Kolejne próby rozwiązania)

Próba 1: Podejrzenie uszkodzenia plików binarnego systemu i bazy termcap

Próba 2: Podejrzenie awarii bibliotek dynamicznych (Błąd linkera)

Próba 3: Próba wymuszenia aktualizacji i naprawy przez freebsd-update

Próba 4: Analiza tabeli montowania i uprawnień katalogów root

3. Przełom i identyfikacja prawdziwej przyczyny

Kluczem do rozwiązania zagadki okazało się prześledzenie rozruchu skryptu startowego linia po linii za pomocą wbudowanego mechanizmu debugowania powłoki sh w trybie awaryjnym (Single-User Mode):

/bin/sh -x /etc/rc

Wynik testu: Skrypt /etc/rc rozpoczynał działanie, ładował podstawowe zmienne, po czym nagle i po cichu kończył pracę (exit 0), całkowicie przerywając dalszą procedurę bootowania. Dalsza weryfikacja za pomocą:

/rescue/cat -n /etc/rc.conf

ujawniła anomalie. Na samym końcu pliku konfiguracyjnego /etc/rc.conf znajdowało się pojedyncze, ukryte polecenie:

exit

Jak do tego doszło? Słowo to zostało najprawdopodobniej przypadkowo zapisane do pliku podczas jednej z sesji SSH (np. poprzez błędne przekierowanie strumienia

echo "coś" > /etc/rc.conf
zamiast dopisania >>, bądź wklejenie komendy wyjścia z terminala bezpośrednio do otwartego edytora).


4. Dlaczego ta jedna linia wywołała tak spektakularną lawinę błędów? (Analiza techniczna)

W systemie FreeBSD plik /etc/rc.conf nie jest pasywnym plikiem tekstowym (jak np. pliki .ini czy .json). Jest on wykonywany metodą tzw. sourcingu (kropki lub polecenia . / source) wewnątrz głównego skryptu startowego /etc/rc. Wstrzyknięcie słowa exit do rc.conf spowodowało, że:

  1. Główny proces systemu (init) wywoływał /etc/rc.
  2. Skrypt /etc/rc w pierwszych linijkach wczytywał /etc/rc.conf.
  3. Interpreter natrafiał na instrukcję exit wewnątrz rc.conf i błyskawicznie zamykał cały proces /etc/rc.
  4. W efekcie system nigdy nie wykonał kolejnych kroków rozruchu:
    • Nie ustawiono nazwy hosta i parametrów sieci (stąd status amnesiac).
    • Nie uruchomiono skryptu montującego dyski z tabeli /etc/fstab (partycja /usr pozostawała fizycznie odłączona w trybie Multi-User).
  5. Gdy init przechodził do kolejnej fazy i próbował uruchomić ekrany logowania z pliku /etc/ttys, odpytywał odłączoną partycję /usr o program /usr/libexec/getty. Ponieważ katalog był pusty, jądro zwracało błąd No such file or directory, prowokując pętlę restartów too quickly.
5. Rozwiązanie (Remedium)

Naprawa systemu wymagała całkowitego odcięcia się od uszkodzonej konfiguracji i przywrócenia spójności z poziomu czystej, statycznej powłoki ratunkowej:

  1. Uruchomienie systemu w trybie Single-User Mode.
  2. Wywołanie w pełni niezależnej powłoki ratunkowej (niepotrzebującej bibliotek dynamicznych):
    Enter full pathname of shell: /rescue/sh
  3. Zamontowanie partycji głównej w trybie zapisu:
    /rescue/mount -u /
  4. Usunięcie wadliwej linii z pliku konfiguracyjnego (za pomocą
    /rescue/ee /etc/rc.conf
    lub automatycznie przez sed).
  5. Przywrócenie fabrycznego, czystego pliku konfiguracji terminali /etc/ttys za pomocą narzędzia fetch.
  6. Wykonanie
    /rescue/reboot
    .

Po usunięciu słowa exit, skrypt /etc/rc wykonał się w całości, automatycznie montując wszystkie partycje UFS2, podnosząc sieć i przywracając sprawność procesu getty na wszystkich konsolach.

Lekcja dla administratorów (Takeaway)


Przypadek 2: BIND+DNSSEC+splitDNS



# BIND 9.20 + DNSSEC + split DNS – przypadek błędnej konfiguracji i diagnostyki
## Opis problemu
Administrator utrzymuje własny serwer DNS oparty o BIND 9.20 na FreeBSD.
Założenia były następujące: Po zmianach w konfiguracji pojawiły się jednocześnie dwa problemy:
  1. strefa zwracała SOA, ale nie zwracała rekordu A dla domeny głównej,
  2. po restarcie named nie były aktualizowane pliki .signed.

# Objawy
Lokalny serwer DNS odpowiadał:
dig @192.168.1.1 domena.pl A
wynik:
status: NOERROR
ANSWER: 0
AUTHORITY: 1
domena.pl. IN SOA ns1.example.pl. hostmaster.example.pl.

Brak rekordu A mimo obecności wpisu:
@ IN A 192.168.1.100
w pliku strefy.
Jednocześnie:
named-checkzone domena.pl domena.pl.zone.db
zwracał:
loaded serial XXXXX
OK

co oznaczało, że plik źródłowy był poprawny.
# Pierwszy trop – strefa nie korzysta z aktualnego pliku
Polecenie:
rndc zonestatus domena.pl
pokazało:
file: domena.pl.zone.db.signed
serial: 202407013
signed serial: 202407376

natomiast:
named-checkzone domena.pl domena.pl.zone.db
pokazywał już nowszy numer seryjny:
2026060105
Oznaczało to, że:
# Dodatkowa komplikacja – pliki .signed.signed
W katalogu stref pojawiły się pliki:
domena.pl.zone.db.signed
domena.pl.zone.db.signed.jbk
domena.pl.zone.db.signed.signed
domena.pl.zone.db.signed.signed.jnl

Jest to typowy objaw sytuacji, gdy:
file "domena.pl.zone.db.signed";
inline-signing yes;

BIND próbuje podpisać już podpisaną strefę. W efekcie tworzone są kolejne poziomy:
.signed
.signed.signed

co prowadzi do chaosu i utrudnia diagnostykę.
# Prawidłowa konfiguracja inline-signing
Dla automatycznego DNSSEC plik strefy powinien wskazywać na plik źródłowy:
zone "domena.pl" {
type primary;
file "/ścieżka/domena.pl.zone.db";
dnssec-policy default;
inline-signing yes;
allow-update { none; };
};

Nie należy wskazywać:
file "domena.pl.zone.db.signed";
jako pliku źródłowego strefy.
# Rozwiązanie
Po poprawieniu konfiguracji wykonano:
service named stop
usunięto stare pliki:
rm domena.pl.zone.db.signed*
następnie:
service named start
Po uruchomieniu BIND automatycznie wygenerował nowe pliki:
domena.pl.zone.db.signed
domena.pl.zone.db.signed.jbk

i załadował aktualną zawartość strefy.
Weryfikacja:
dig @192.168.1.1 domena.pl A +short
wynik:
192.168.1.100
Problem został rozwiązany.
# Drugi problem – dziwna nazwa domena.pl.example.pl
Polecenie:
nslookup domena.pl 8.8.8.8
zwracało:
Aliases: domena.pl.example.pl
co sugerowało błędną konfigurację DNS.
Po analizie okazało się, że:
cat /etc/resolv.conf
zawierało:
search example.pl
oraz publiczna strefa example.pl posiadała rekord:
*.example.pl CNAME example.pl
W efekcie resolver próbował automatycznie dopisywać sufiks:
domena.pl → domena.pl.example.pl
a wildcard odpowiadał poprawnym rekordem. Nie był to błąd DNS domeny.pl, lecz efekt działania mechanizmu search domain.
# Split DNS – poprawna interpretacja
W tym przypadku administrator celowo utrzymywał dwie różne wersje tej samej domeny:
## Publiczny DNS
domena.pl -> 88.x.x.x
obsługiwany przez zewnętrznego operatora.
## Lokalny DNS
domena.pl -> 192.168.1.100
obsługiwany przez własny serwer BIND.
Jest to klasyczna konfiguracja split DNS i sama w sobie nie stanowi błędu.
# Czy usuwać "search example.pl"?
Nie zawsze. Jeżeli administrator korzysta z nazw skróconych:
ssh serwer1
ping nas
ping backup

to wpis:
search example.pl
jest przydatny. Należy jednak pamiętać, że powoduje on automatyczne rozwijanie nazw:
host → host.example.pl
oraz
domena.pl → domena.pl.example.pl
gdy resolver uzna, że nazwa nie jest w pełni kwalifikowana.
# Czy usuwać wildcard *.example.pl?
Nie w każdym przypadku. Wildcard:
*.example.pl CNAME example.pl
jest często wykorzystywany do obsługi usług typu:
jellyfin.example.pl
grafana.example.pl
nextcloud.example.pl

Usunięcie go może spowodować niedziałanie wielu istniejących subdomen. Przed usunięciem należy sprawdzić, czy nie jest używany przez działające usługi.
# Wnioski
Najważniejsze przyczyny problemu:
  1. Strefa korzystała ze starego pliku .signed.
  2. W katalogu pojawiły się pliki .signed.signed, co wskazywało na błędny przebieg podpisywania.
  3. Po usunięciu starych plików podpisanych BIND wygenerował je ponownie i załadował aktualną strefę.
  4. Rekord A dla domeny głównej wrócił do odpowiedzi DNS.
  5. Alias domena.pl.example.pl nie wynikał z błędu strefy, lecz z konfiguracji search w resolverze oraz obecności wildcarda w strefie nadrzędnej.
  6. Split DNS działał prawidłowo – problem dotyczył procesu DNSSEC i plików podpisanych, a nie samej koncepcji rozdzielenia DNS publicznego i prywatnego.


Przypadek 3: tworzenie sitemap.xml i 404



Studium przypadku: sitemap.xml, błędy 404 i problemy z narzędziami analitycznymi
Wstęp

W trakcie pracy nad rozbudowaną witryną składającą się z kilkuset statycznych stron HTML wykonano standardową kontrolę techniczną serwisu po wygenerowaniu mapy witryny (sitemap.xml).

Celem było sprawdzenie poprawności indeksacji oraz weryfikacja, czy wszystkie adresy zwracają kod HTTP 200.

Wyniki pozornie były proste — mapa witryny działała, a strona była dostępna. Jednak analiza crawlerem wykazała kilka błędów 404, których lokalizacja w kodzie nie była oczywista.


Problem

Po uruchomieniu skanowania narzędziem typu crawler pojawiło się kilka adresów zwracających błąd 404.

Co istotne:

Problem polegał nie tyle na samej liczbie błędów, co na braku jednoznacznej informacji, skąd one pochodzą.


Pierwsza diagnoza

Naturalnym krokiem jest przeszukanie kodu HTML pod kątem błędnego adresu. W praktyce jednak nie zawsze prowadzi to do rozwiązania problemu.

Odwołania do nieistniejących zasobów mogą znajdować się w różnych miejscach:

W efekcie ręczne przeszukiwanie pojedynczych plików często nie daje natychmiastowego wyniku.


Weryfikacja sitemap.xml

Jednym z pierwszych kroków powinna być analiza samej mapy witryny.

W wielu przypadkach błędy 404 wynikają z:

Każdy adres w sitemap.xml powinien zwracać kod HTTP 200. Jeśli tak nie jest, mapa witryny wprowadza w błąd mechanizmy indeksujące oraz narzędzia analityczne.


Problemy z narzędziami do skanowania i generowania sitemap

W trakcie analizy okazało się, że duża część trudności nie wynikała z samej witryny, ale z narzędzi używanych do jej analizy.

Różne wyniki w różnych crawlerach

Różne narzędzia dawały różne rezultaty:

Brak spójności utrudniał jednoznaczną ocenę sytuacji.


Brak informacji o źródle błędu

Część narzędzi wskazywała jedynie adres 404, bez informacji:

Powodowało to konieczność ręcznego przeszukiwania całej struktury serwisu.


Błędy spoza HTML

Nie wszystkie wykryte adresy pochodziły bezpośrednio z treści strony.

Część była generowana przez:

W efekcie część błędów nie miała „widocznego” miejsca w HTML.


Problemy z generatorem sitemap

Dodatkowym źródłem niejednoznaczności był sam generator sitemap.xml, który:

W rezultacie mapa witryny mogła zawierać adresy, które nie były już częścią aktualnej struktury serwisu.


Wnioski praktyczne

Analiza przypadku prowadzi do kilku wniosków:

W praktyce nawet niewielka liczba błędów może wskazywać na pozostałości po wcześniejszych zmianach w strukturze strony.


Zakończenie

W środowisku rozbudowanych serwisów statycznych najtrudniejszym elementem nie jest samo wykrycie błędu, ale jego poprawna interpretacja.

Crawler i sitemap są narzędziami pomocniczymi — przydatnymi, ale nieomylne dane trzeba zawsze potwierdzić w kodzie źródłowym oraz strukturze serwera.

Dopiero połączenie analizy narzędziowej i ręcznej weryfikacji pozwala uzyskać pełny obraz stanu technicznego witryny.

Przypadek 4: sitemap - a co widzi Google

Sitemap, crawlery i SEO techniczne – czyli co tak naprawdę widzi Google

W praktyce administracji stron WWW bardzo często pojawia się uproszczenie: „mam sitemapę, więc Google wie wszystko o mojej stronie”. To jedno z tych zdań, które brzmią sensownie, ale w realnym świecie technicznym są tylko częściowo prawdziwe.

Sitemap XML nie jest mapą w sensie diagnostycznym. To jest raczej lista adresów URL przekazana robotowi wyszukiwarki. Google dostaje informację: „te strony istnieją”. Ale to nie oznacza, że te strony są poprawne, dostępne, dobrze połączone albo wartościowe w strukturze serwisu.

Sitemap – lista, nie analiza

Plik sitemap.xml pełni jedną funkcję: pokazuje robotowi wyszukiwarki, jakie adresy URL powinny zostać uwzględnione w indeksowaniu. I to wszystko.

Nie sprawdza on:

Sitemap jest więc bardziej deklaracją niż analizą. Można powiedzieć, że to „spis treści”, ale bez sprawdzania, czy wszystkie rozdziały nadal istnieją.

Crawlery – czyli jak Google „czyta” stronę

Zupełnie inną klasą narzędzi są crawlery. To one działają podobnie do Googlebota: przechodzą po stronie link po linku i sprawdzają jej rzeczywisty stan.

Crawler:

Dopiero na podstawie takiego skanu można powiedzieć coś o „zdrowiu” strony, a nie tylko o jej liście adresów.

Broken links – sygnał, nie katastrofa

W trakcie crawlowania często pojawiają się tzw. broken links (np. 404). Wbrew popularnemu podejściu nie są one automatycznie problemem krytycznym dla SEO. Google nie „karze” za pojedyncze błędy tego typu.

Problem zaczyna się dopiero wtedy, gdy:

Wtedy nie chodzi już o pojedyncze błędy, ale o degradację spójności całego serwisu.

Sitemap vs crawler – różnica, która robi różnicę

W praktyce te dwa podejścia często są mylone, bo wiele narzędzi łączy je w jednym interfejsie. Ale funkcjonalnie to są dwa różne światy:

I dopiero zestawienie tych dwóch perspektyw daje realny obraz strony.

Wnioski praktyczne

W przypadku stron średniej wielkości (kilkaset do kilku tysięcy podstron) często zaczyna się moment, w którym sama sitemap przestaje być wystarczająca jako narzędzie kontroli.

Pojawia się wtedy potrzeba spojrzenia na stronę jak Googlebot:

I to jest moment, w którym SEO techniczne zaczyna mieć większe znaczenie niż sama obecność sitemapy.

Przypadek 5: DNSSEC i zarządzanie domeną

Case study: DNSSEC w środowisku hostingowym – gdzie kończy się technologia, a zaczyna organizacja

DNSSEC w teorii jest prostym mechanizmem: podpisujemy strefę DNS, publikujemy rekordy kryptograficzne i zyskujemy ochronę przed podszywaniem się pod odpowiedzi DNS. W praktyce jednak wdrożenie w środowisku hostingowym pokazuje, że największym problemem nie jest sama technologia, ale model zarządzania domeną.

Założenie

Celem było sprawdzenie, czy DNSSEC można włączyć w typowej konfiguracji: domena krajowa (.pl), DNS zarządzany przez dostawcę hostingu, bez własnej infrastruktury DNS.

Weryfikacja stanu

Pierwszym krokiem była kontrola delegacji zabezpieczeń:

dig domena.pl DS

Brak rekordu DS w odpowiedzi oznacza brak aktywnego DNSSEC po stronie rejestru.

Następnie sprawdzono strefę DNS:

Wniosek był jednoznaczny: strefa DNS nie jest podpisana, a DNSSEC nie jest aktywny.

Problem praktyczny

W środowiskach hostingowych często nie ma bezpośredniego przełącznika DNSSEC w panelu użytkownika, mimo że:

Brakuje jednak elementu kluczowego: publikacji rekordu DS w rejestrze domeny.

Kluczowy wniosek

DNSSEC nie jest usługą „po stronie hostingu DNS”, tylko elementem łańcucha zależności:

rejestr domeny → delegacja DS → serwery DNS → podpisana strefa

Oznacza to, że:

Konkluzja

DNSSEC w praktyce ujawnia typowy problem infrastruktury DNS: rozdzielenie odpowiedzialności.

Z punktu widzenia administratora:

W efekcie technologia, która ma zwiększać bezpieczeństwo, często okazuje się trudna nie dlatego, że jest skomplikowana, ale dlatego, że jest rozproszona między różne systemy.

Przypadek 6: sprzętowe wybory - komputer dla OPNsense




 Wybór sprzętu pod firewall 2.5G / 10G (OPNsense / FreeBSD) – case study
 Wstęp

Dobór sprzętu do nowoczesnego firewalla opartego o OPNsense przestał być prosty. W praktyce nie wybiera się już „routera”, tylko mały serwer brzegowy (edge firewall).

W analizowanym przypadku celem było zbudowanie urządzenia:


 Kluczowy problem

W urządzeniach klasy AliExpress (CWWK / Topton / OEM):

Największe obciążenia nie wynikają z NAT, ale z:


 Testowane klasy CPU
 1. CPU legacy (i3-5010U / i3-8140U)

👉 wniosek: nie nadają się do 2.5G


 2. CPU energooszczędne (N300 / N305 / N355)

👉 wniosek:

świetne do routera, ale ograniczone pod IDS i VPN przy dużym ruchu


 3. CPU wydajnościowe (i5-8259U / i5-1235U)

👉 wniosek:

najlepsza klasa dla firewalla 2.5G+ z zapasem


Tabela porównawcza (realna klasa firewall)
CPURdzeniePassMarkNAT 2.5GVPNIDS/IPSKlasa
i3-5010U2C/4T~2klegacy
i3-8140U2C/4T~4k🟡basic
N3008C/8T~6k🟡🟡low-power
N3058C/8T~9–10k🟢🟡🟡edge router
N3558C/8T~11k🟢🟢🟡🟢strong low-power
i5-8259U4C/8T~8k🟢🟢🟡mid firewall
i5-1235U10C/12T~13–14k🟢🟢🟢🟢🟢🟢optimal firewall

 Finalna architektura (reference design)

W toku analizy wybrano docelową konfigurację:

 Intel i5-1235U + 6× Intel i226-V + 2× 10GbE uplink


Topologia:
 Dlaczego ten wybór wygrał
 1. Zrównoważony CPU

i5-1235U oferuje:

👉 klucz:

firewall musi mieć headroom, nie tylko „peak performance”


 2. Rozdzielenie warstw sieci

👉 efekt:


 3. Kompatybilność FreeBSD
 4. RAM 16 GB
 Dlaczego nie N-series

Mimo dobrych parametrów energetycznych:

👉 wniosek:

N-series = edge router
i5-1235U = edge firewall


 Kluczowy wniosek

W firewallach 2.5G–10G nie wygrywa najniższy pobór energii, tylko stabilny zapas CPU przy szczytowym obciążeniu (VPN + IDS + routing).


 Podsumowanie
 Najlepszy wybór (reference design)  Energooszczędna alternatywa  Minimum sensowne  Odrzucone
 Konkluzja

Dobór sprzętu firewall w tej klasie nie polega na wyborze „najmocniejszego CPU”, tylko na znalezieniu punktu, w którym:




 Tekst PL
EN Tekst  


Case Studies

Case 1: getty


Case Study: How a single line in rc.conf paralyzed FreeBSD and misled system diagnostics
System context
* Operating system: FreeBSD (amd64 architecture)
* File system: UFS2 (classic partition layout, including separate mount points / and /usr)
* Additional services: Active container/jail environments managed from the host system

1. Failure symptoms (primary symptoms)
After reboot, the system was unable to enter normal multi-user mode and fell into a loop of critical console errors:
1. Getty loop
The screen was flooded with messages:
init: cant exec getty /usr/libexec/getty for port /dev/ttyv0: no such file or directory
followed by:
getty repeating too quickly on port ttyv0, sleeping 30 secs.
This affected all virtual consoles from ttyv0 to ttyv7.
2. Single-User Mode failure
Attempting to enter single-user mode for repair resulted in repeated message:
cannot read termcap database.
This prevented proper operation of standard shells and advanced editors (e.g. vi), forcing work in a dump terminal mode.
3. “Amnesiac” status
In rare moments when the system allowed interaction in multi-user mode, it identified itself under the default kernel name: amnesiac.
There was no access to /usr/bin/login, and network interfaces as well as jail containers remained inactive.
2. Diagnostic timeline and dead ends (successive attempts)
Attempt 1: suspected corruption of system binaries and termcap database
cap_mkdb

Attempt 2: suspected dynamic library failure (linker issue)
objdump -p

Attempt 3: forced recovery via freebsd-update
freebsd-update fetch install
or
freebsd-update IDS

Attempt 4: mount table and root directory permissions analysis
mount -u /
and
mount -a
Attempt to move getty and termcap database to root partition / to bypass /usr structure.
3. Breakthrough and identification of root cause
The key to solving the mystery was step-by-step boot script tracing using shell debug mode in single-user environment:
/bin/sh -x /etc/rc
Result: /etc/rc started, loaded base variables, then silently terminated (exit 0), stopping the boot process.
Further inspection:
/rescue/cat -n /etc/rc.conf
revealed an anomaly. At the end of the configuration file /etc/rc.conf there was a single hidden command:
exit

How did this happen?
The word was most likely accidentally written into the file during an SSH session, e.g.:
echo "something" > /etc/rc.conf
instead of append (>>), or by pasting a terminal exit command directly into an open editor.
4. Why did this single line cause such a cascade of failures? (technical analysis)
In FreeBSD, /etc/rc.conf is not a passive configuration file (like .ini or .json). It is executed via sourcing (dot or source) inside the main startup script /etc/rc.
Injection of exit into rc.conf caused:
  1. init process executed /etc/rc
  2. /etc/rc loaded /etc/rc.conf
  3. interpreter encountered exit inside rc.conf and immediately terminated /etc/rc
  4. system never executed further boot steps:
    • hostname and network configuration not set (hence amnesiac state)
    • disk mounting scripts from /etc/fstab not executed (/usr remained unmounted in multi-user mode)
  5. when init proceeded and tried to start login terminals via /etc/ttys, it queried /usr/libexec/getty on unmounted /usr partition → No such file or directory → restart loop (too quickly)

5. Solution (remedy)
System recovery required complete isolation from broken configuration and restoration via static rescue shell:
  1. Boot into single-user mode
  2. Start independent rescue shell:
Enter full pathname of shell: /rescue/sh
  1. Mount root filesystem read-write:
/rescue/mount -u /
  1. Remove faulty line from configuration:
/rescue/ee /etc/rc.conf
(or via sed)
  1. Restore default terminal configuration /etc/ttys (via fetch)
  2. Reboot:
/rescue/reboot

After removing the word exit, /etc/rc executed fully, mounting all UFS2 partitions, bringing up networking, and restoring getty processes on all consoles.
Lesson for administrators (takeaway)

Case 2: BIND + DNSSEC + splitDNS


BIND 9.20 + DNSSEC + split DNS – case of incorrect configuration and diagnostics
Problem description
The administrator maintains a custom DNS server based on BIND 9.20 on FreeBSD.
The assumptions were as follows:
* the public zone domena.pl is managed by an external DNS provider,
* the local BIND server maintains its own version of the same zone exclusively for the LAN,
* in the local network domena.pl resolves to a private address (e.g. 192.168.1.100),
* on the Internet domena.pl resolves to a public address (e.g. 88.x.x.x),
* DNSSEC is handled automatically using:
dnssec-policy default;
and
inline-signing yes;
.
After configuration changes, two problems appeared simultaneously:
  1. the zone returned SOA but did not return an A record for the root domain,
  2. after restarting named, .signed files were not updated.

Symptoms
The local DNS server responded:
dig @192.168.1.1 domena.pl A
Result:
status: NOERROR
ANSWER: 0
AUTHORITY: 1
domena.pl. IN SOA ns1.example.pl. hostmaster.example.pl.
No A record despite the presence of:
@ IN A 192.168.1.100
in the zone file.
At the same time:
named-checkzone domena.pl domena.pl.zone.db
returned:
loaded serial XXXXX
OK
which indicated that the source file was correct.
First lead – zone not using the current file
Command:
rndc zonestatus domena.pl
showed:
file: domena.pl.zone.db.signed
serial: 202407013
signed serial: 202407376
while:
named-checkzone domena.pl domena.pl.zone.db
showed a newer serial number:
2026060105
This meant that:
* the source file had been modified,
* BIND was aware of the new data,
* but the active zone was still using the old signed file.

Additional complication – .signed.signed files
In the zone directory, the following files appeared:
domena.pl.zone.db.signed
domena.pl.zone.db.signed.jbk
domena.pl.zone.db.signed.signed
domena.pl.zone.db.signed.signed.jnl
This is a typical symptom of a situation where:
file "domena.pl.zone.db.signed";
inline-signing yes;
BIND attempts to sign an already signed zone. As a result, multiple layers are created:
.signed
.signed.signed
which leads to chaos and makes diagnostics difficult.
Correct inline-signing configuration
For automatic DNSSEC, the zone file should point to the source file:
zone "domena.pl" {
type primary;
file "/path/domena.pl.zone.db";
dnssec-policy default;
inline-signing yes;
allow-update { none; };
};
It must NOT point to:
file "domena.pl.zone.db.signed";
as the source zone file.
Solution
After correcting the configuration:
service named stop
Old files were removed:
rm domena.pl.zone.db.signed*
Then:
service named start
After startup, BIND automatically generated new files:
domena.pl.zone.db.signed
domena.pl.zone.db.signed.jbk
and loaded the current zone content.
Verification:
dig @192.168.1.1 domena.pl A +short
Result:
192.168.1.100
The problem was resolved.
Second problem – strange domain name domena.pl.example.pl
Command:
nslookup domena.pl 8.8.8.8
returned:
Aliases: domena.pl.example.pl
which suggested a DNS misconfiguration.
After analysis it turned out that:
cat /etc/resolv.conf
contained:
search example.pl
and the public zone example.pl contained the record:
*.example.pl CNAME example.pl
As a result, the resolver automatically appended the suffix:
domena.pl → domena.pl.example.pl
and the wildcard returned a valid record.
This was not an error in the domena.pl zone, but a result of the search domain mechanism.
Split DNS – correct interpretation
In this case, the administrator intentionally maintained two different versions of the same domain:
Public DNS
domena.pl -> 88.x.x.x
managed by an external provider.
Local DNS
domena.pl -> 192.168.1.100
managed by a local BIND server.
This is a classic split DNS configuration and is not an error in itself.
Should "search example.pl" be removed?
Not always. If the administrator uses short hostnames:
ssh serwer1
ping nas
ping backup
then:
search example.pl
is useful.
However, it must be remembered that it automatically expands names:
host → host.example.pl
and
domena.pl → domena.pl.example.pl
when the resolver considers the name not fully qualified.
Should wildcard *.example.pl be removed?
Not always.
Wildcard:
*.example.pl CNAME example.pl
is often used for services such as:
* jellyfin.example.pl
* grafana.example.pl
* nextcloud.example.pl
Removing it may break many existing subdomains. Before removal, it must be verified whether it is used by active services.
Conclusions
Main causes of the problem:
  1. The zone was using an old .signed file.
  2. .signed.signed files appeared in the directory, indicating incorrect signing process.
  3. After removing old signed files, BIND regenerated them and loaded the updated zone.
  4. The A record for the root domain was restored.
  5. The domena.pl.example.pl alias was not caused by a zone error, but by resolver search configuration and wildcard presence in the parent zone.
  6. Split DNS worked correctly – the issue was related to DNSSEC signing files, not the split DNS concept itself.




Case 3: sitemap.xml creation and 404 errors


Case study: sitemap.xml, 404 errors, and issues with analytical tools
Introduction
During work on a large website consisting of several hundred static HTML pages, a standard technical audit of the site was performed after generating the sitemap.xml file.
The goal was to verify indexing correctness and check whether all URLs return HTTP 200 status codes.
The initial results seemed straightforward — the sitemap worked and the site was accessible. However, crawler analysis revealed several 404 errors whose origin in the code was not obvious.
Problem
After running a scan with a crawler tool, several URLs returning 404 errors were detected.
What is important:
* the number of errors was small,
* the pages themselves worked correctly,
* there was no obvious place in the HTML where these URLs were used.
The problem was not the number of errors itself, but the lack of a clear indication of their origin.
First diagnosis
The natural step is to search the HTML code for the incorrect URL. In practice, however, this does not always solve the problem immediately.
References to non-existing resources can be located in different places:
* in HTML tags (<img>, <a>, <script>, <link>),
* in CSS (url(...)),
* in JavaScript (dynamic assignments),
* in srcset,
* in shared templates used across multiple pages,
* in sitemap.xml.
As a result, manual searching through individual files often does not produce immediate results.
Sitemap.xml verification
One of the first steps should be analysis of the sitemap itself.
In many cases, 404 errors result from:
* leaving old URLs in sitemap.xml,
* outdated entries after changes in site structure,
* sitemap generation errors from automated tools.
Every URL in sitemap.xml should return HTTP 200. If it does not, the sitemap misleads indexing mechanisms and analytical tools.
Issues with sitemap and crawling tools
During analysis it turned out that a large part of the difficulty did not come from the website itself, but from the tools used to analyze it.
Different results in different crawlers
Different tools produced different results:
* one detected 404 errors,
* another did not report them at all,
* yet another found URLs that did not exist in the code.
The lack of consistency made it difficult to assess the situation clearly.
Lack of error source information
Some tools only indicated the 404 URL, without information about:
* which page contained the reference,
* in which element the link was found.
This required manual searching through the entire site structure.
Non-HTML errors
Not all detected URLs came directly from page content.
Some were generated by:
* CSS (e.g. background images),
* JavaScript (dynamic assignments),
* conditionally loaded elements,
* outdated entries in static assets.
As a result, some errors had no “visible” location in HTML.
Issues with sitemap generators
An additional source of ambiguity was the sitemap.xml generator itself, which:
* could retain outdated URLs,
* did not always refresh structure after changes,
* sometimes relied on historical data.
As a result, the sitemap could contain URLs that were no longer part of the current site structure.
Practical conclusions
The analysis of this case leads to several conclusions:
* no single tool provides a complete picture of the site state,
* crawler results should be treated as a starting point, not final truth,
* each 404 error requires verification of its source, not just the URL,
* sitemap.xml must be treated as an active element, not a one-time generated file.
In practice, even a small number of errors may indicate remnants of previous structural changes.
Conclusion
In complex static web environments, the most difficult aspect is not detecting an error itself, but correctly interpreting it.
Crawlers and sitemaps are supporting tools — useful, but not definitive. Reliable conclusions must always be verified in the source code and server structure.
Only the combination of tool-based analysis and manual verification provides a full picture of the technical state of a website.





Case 4: sitemap – and what Google actually sees


Sitemap, crawlers and technical SEO – i.e. what Google actually sees
In practice of website administration, a very common simplification appears: “I have a sitemap, so Google knows everything about my website.” This is one of those statements that sounds reasonable, but in the real technical world they are only partially true.
An XML sitemap is not a map in a diagnostic sense. It is rather a list of URLs passed to the search engine robot. Google receives the information: “these pages exist.” But this does not mean that these pages are correct, accessible, well connected, or valuable within the site structure.
Sitemap – a list, not an analysis
The sitemap.xml file performs one function: it shows the search engine robot which URLs should be included in indexing. And that is all.
It does not check:
* whether the page returns a 404 error,
* whether internal links lead to existing resources,
* whether the site structure is logical,
* whether a given subpage is an orphan page.
The sitemap is therefore more a declaration than an analysis. One could say that it is a “table of contents”, but without checking whether all chapters still exist.
Crawlers – i.e. how Google “reads” a page
A completely different class of tools are crawlers. These are what work similarly to Googlebot: they go through the page link by link and check its actual state.
Crawler:
* visits every page like a user or bot,
* analyzes server responses (200, 301, 404, 500),
* detects broken links,
* maps the structure of connections between subpages.
Only on the basis of such a scan can one say something about the “health” of the site, and not only about its list of addresses.
Broken links – a signal, not a catastrophe
During crawling, so-called broken links (e.g. 404) often appear. Contrary to the popular approach, they are not automatically a critical SEO problem. Google does not “punish” single errors of this type.
The problem starts only when:
* errors occur in internal links,
* the site structure relies on non-existing resources,
* the linking architecture gradually becomes disorganized.
Then it is no longer about individual errors, but about degradation of the consistency of the entire site.
Sitemap vs crawler – a difference that makes a difference
In practice, these two approaches are often confused, because many tools combine them in a single interface. But functionally, these are two different worlds:
* sitemap says: “what should exist”
* crawler says: “what actually works”
And only combining these two perspectives gives a real picture of the site.
Practical conclusions
In the case of medium-sized websites (several hundred to several thousand subpages), a moment often comes when the sitemap alone is no longer sufficient as a control tool.
Then there is a need to look at the site like Googlebot:
* through crawl,
* through link analysis,
* through verification of structure, not only the URL list.
And that is the moment when technical SEO starts to matter more than the mere presence of a sitemap.

Case 5: DNSSEC and domain management


Case study: DNSSEC in a hosting environment – where technology ends and organization begins
DNSSEC in theory is a simple mechanism: we sign the DNS zone, publish cryptographic records, and gain protection against DNS response spoofing. In practice, however, implementation in a hosting environment shows that the biggest problem is not the technology itself, but the domain management model.
Assumption
The goal was to check whether DNSSEC can be enabled in a typical configuration: national domain (.pl), DNS managed by a hosting provider, without own DNS infrastructure.
State verification
The first step was checking security delegation:
dig domena.pl DS
The absence of a DS record in the response means no active DNSSEC on the registry side.
Next, the DNS zone was checked:
* no DNSKEY records
* no RRSIG signatures
The conclusion was clear: the DNS zone is not signed, and DNSSEC is not active.
Practical problem
In hosting environments there is often no direct DNSSEC switch in the user panel, even though:
* DNS is fully managed from the hosting side,
* the DNS zone works correctly,
* records can be freely edited.
However, one key element is missing: publication of the DS record in the domain registry.
Key conclusion
DNSSEC is not a “DNS hosting-side service”, but an element of a dependency chain:
domain registry → DS delegation → DNS servers → signed zone
This means that:
* correct DNS configuration does not guarantee DNSSEC,
* the hosting panel does not always provide full control over domain security,
* activation often requires action on the registrar side or technical support.
Conclusion
DNSSEC in practice reveals a typical DNS infrastructure problem: separation of responsibilities.
From an administrator’s point of view:
* DNSSEC is not a “setting”, but a process in a service chain,
* the absence of a single element (DS) invalidates the entire configuration,
* and visibility in hosting panels can be misleading.
As a result, a technology that is supposed to increase security often turns out to be difficult not because it is complex, but because it is distributed across different systems.



Case 6: hardware choices – computer for OPNsense


Hardware selection for 2.5G / 10G firewall (OPNsense / FreeBSD) – case study
Introduction
Selecting hardware for a modern firewall based on OPNsense has stopped being simple. In practice, you no longer choose a “router”, but a small edge server (edge firewall).
In the analyzed case, the goal was to build a device:
* with OPNsense system (FreeBSD)
* 2.5G support (LAN)
* 10G uplink (WAN/backbone)
* minimum 6× Intel i226-V (LAN interfaces)
* RAM 8–16 GB
* 24/7 stability
* budget ~1500–2000 PLN
Key problem
In AliExpress-class devices (CWWK / Topton / OEM):
* network card (Intel i226-V) is fixed
* RAM and SSD are secondary
* CPU defines the real firewall class
The biggest loads do not come from NAT, but from:
* VPN (WireGuard / OpenVPN)
* IDS/IPS (Suricata / Zenarmor)
* burst traffic (peak 2.5G–10G load)
Tested CPU classes
1. Legacy CPUs (i3-5010U / i3-8140U)
* low performance
* no CPU headroom
* only basic NAT/firewall
👉 conclusion: not suitable for 2.5G
2. Energy-efficient CPUs (N300 / N305 / N355)
* very low power consumption
* good efficiency per Watt
* limited peak performance
👉 conclusion:
great as a router, but limited for IDS and VPN under heavy load

3. Performance CPUs (i5-8259U / i5-1235U)
* higher single-core performance
* better VPN throughput
* larger CPU headroom
* more stable operation under IDS
👉 conclusion:
best class for 2.5G+ firewall with headroom

Comparison table (real firewall class)
CPUCoresPassMarkNAT 2.5GVPNIDS/IPSClass
i3-5010U2C/4T~2klegacy
i3-8140U2C/4T~4k🟡basic
N3008C/8T~6k🟡🟡low-power
N3058C/8T~9–10k🟢🟡🟡edge router
N3558C/8T~11k🟢🟢🟡🟢strong low-power
i5-8259U4C/8T~8k🟢🟢🟡mid firewall
i5-1235U10C/12T~13–14k🟢🟢🟢🟢🟢🟢optimal firewall

Final architecture (reference design)
During the analysis, the final configuration was selected:
 Intel i5-1235U + 6× Intel i226-V + 2× 10GbE uplink
Topology:
* WAN: 2×10G (uplink / ISP / backbone / aggregation)
* LAN: 6×2.5G Intel i226-V (VLAN segmentation / DMZ / LAN)
* CPU: Intel i5-1235U
* RAM: 16 GB DDR4
* Storage: NVMe SSD

Why this choice won
1. Balanced CPU
i5-1235U offers:
* high single-core performance (VPN, routing)
* 10 cores (P + E cores)
* stable throughput under IDS load
* large CPU headroom
👉 key:
firewall must have headroom, not only “peak performance”

2. Separation of network layers
* 2×10G → uplink / backbone
* 6×2.5G → LAN segmentation
👉 effect:
* no interface bottleneck
* no VLAN congestion

3. FreeBSD compatibility
* Intel i226-V → igc driver
* stable OPNsense 24+ support
* proven firewall platform

4. 16 GB RAM
* no swap under IDS
* stable logging
* buffer for Suricata / Zenarmor

Why not N-series
Despite good energy parameters:
* N300 / N305 / N355 have limited single-core performance
* IDS and VPN are CPU-bound
* at 10G and heavy traffic there is no headroom
👉 conclusion:
N-series = edge router
i5-1235U = edge firewall

Key conclusion
In 2.5G–10G firewalls the winner is not the lowest power consumption, but stable CPU headroom under peak load (VPN + IDS + routing).

Summary
Best choice (reference design)
* i5-1235U + 6× i226-V + 2×10G 

Energy-efficient alternative
* N355 

Minimum reasonable
* N305 

Rejected
* i3-5010U
* i3-8140U
* N300

Conclusion
Firewall hardware selection in this class is not about choosing “the strongest CPU”, but about finding the point where:
* CPU is not a bottleneck under burst traffic
* IDS does not saturate the system
* VPN maintains stable throughput
* 2.5G/10G networking does not cause throttling







 Tekst EN
Powrót na stronę główną - Informacje o stronie, prawa autorskie, legalność itd. tutaj
Informacje o przetwarzaniu i ochronie danych osobowych, kontakt i zapytania itd. tutaj
Prywatne serwery Zbigniewa Kuleszy zjk.pl. Aktualny dostawca Internetu - Vectra.pl, Wszelkie prawa zastrzeżone. Zespół redakcyjny zjk.pl: zjk7@wp.pl
W sprawie treści i działania strony oraz w sprawie funkcjonowania i udostępniania treści na serwerach zjk.pl - kontakt z administratorem: webmaster@zjk.pl lub zjk7@wp.pl

Valid HTML 4.01 Transitional Valid XHTML 1.0 Transitional Poprawny CSS! Poprawny CSS!

Copyright (c): Zbigniew Kulesza, Sieradz 2002-2026

KONIEC