<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web | Jonas HOPP</title>
	<atom:link href="https://jonas.hopp.fr/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>https://jonas.hopp.fr</link>
	<description>Photographer &#38; Digital Strategist</description>
	<lastBuildDate>Thu, 05 Nov 2026 11:58:50 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>Why Your Brother Wi-Fi Printer Shows &#8216;Offline&#8217; When Turned On (The 0.0.0.0 DHCP Bug) — And a 1-Click Fix</title>
		<link>https://jonas.hopp.fr/why-your-brother-wi-fi-printer-shows-offline-when-turned-on-the-0-0-0-0-dhcp-bug-and-a-1-click-fix/</link>
					<comments>https://jonas.hopp.fr/why-your-brother-wi-fi-printer-shows-offline-when-turned-on-the-0-0-0-0-dhcp-bug-and-a-1-click-fix/#respond</comments>
		
		<dc:creator><![CDATA[Jonas Hopp]]></dc:creator>
		<pubDate>Thu, 05 Nov 2026 11:57:55 +0000</pubDate>
				<category><![CDATA[Technique]]></category>
		<category><![CDATA[Tips et autres astuces]]></category>
		<guid isPermaLink="false">https://jonas.hopp.fr/?p=567</guid>

					<description><![CDATA[Deep dive into why Brother wireless laser printers (HL-1210W / NC-8400w) randomly wipe their IPv4 address to 0.0.0.0 while keeping Wi-Fi Link OK, why Windows WSD ports get stuck Offline, and how to permanently fix both with a 1-command PowerShell or Python script.]]></description>
										<content:encoded><![CDATA[
<p><style>
.jh-code-card {
  margin: 1.5rem 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #2d3748;
  background: #0f172a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.jh-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: #e2e8f0;
}
.jh-code-title {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.jh-code-lang {
  background: #334155;
  color: #38bdf8;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
}
.jh-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 5px;
  padding: 0.32rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.jh-copy-btn:hover {
  background: #1d4ed8;
}
.jh-copy-btn.copied {
  background: #16a34a;
}
.jh-code-pre {
  margin: 0 !important;
  padding: 1rem 1.15rem !important;
  overflow-x: auto;
  background: #0f172a !important;
  color: #f8fafc !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 0.85rem !important;
  line-height: 1.55 !important;
  border: none !important;
}
.jh-code-pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  font-family: inherit !important;
}
</style> <script>
function jhCopyCode(btn, codeId) {
  var el = document.getElementById(codeId);
  if (!el) return;
  var text = el.innerText || el.textContent;
  var span = btn.querySelector('span');
  function markCopied() {
    btn.classList.add('copied');
    if (span) span.textContent = 'Copied!';
    setTimeout(function() {
      btn.classList.remove('copied');
      if (span) span.textContent = 'Copy code';
    }, 2000);
  }
  if (navigator.clipboard && navigator.clipboard.writeText) {
    navigator.clipboard.writeText(text).then(markCopied).catch(function() {
      var ta = document.createElement('textarea');
      ta.value = text;
      document.body.appendChild(ta);
      ta.select();
      document.execCommand('copy');
      document.body.removeChild(ta);
      markCopied();
    });
  } else {
    var ta = document.createElement('textarea');
    ta.value = text;
    document.body.appendChild(ta);
    ta.select();
    document.execCommand('copy');
    document.body.removeChild(ta);
    markCopied();
  }
}
</script></p>



<p class="wp-block-paragraph">If you own a compact Brother wireless laser printer—such as the <strong>Brother HL-1210W</strong>, <strong>HL-1110W</strong>, <strong>HL-L2300D/W</strong>, or any model built around Brother&rsquo;s <strong><code>NC-8400w</code></strong> / <strong><code>NC-8000w</code></strong> embedded 802.11b/g/n network card—you have probably experienced this maddening scenario:</p>



<ol class="wp-block-list">
<li>The printer is turned on, sitting right next to your router with a solid green Ready LED.</li>
<li>Windows shows the printer as <strong><code>Offline</code></strong>.</li>
<li>Pinging the printer&rsquo;s IP address returns <code>Destination host unreachable</code> (ARP state: <code>Unreachable</code>).</li>
<li>Even scanning your entire local subnet (<code>192.168.x.1–254</code>) confirms the printer hasn&rsquo;t simply picked up a new DHCP address—it has completely vanished from Layer 3.</li>
</ol>



<p class="wp-block-paragraph">Instead of endlessly power-cycling the printer every few days, I decided to inspect both the <strong>Windows Print Spooler / WSD stack</strong> and the <strong>printer&rsquo;s embedded network firmware</strong>. What I found was a two-headed bug—and thankfully, both halves can be permanently fixed in 10 seconds with a single script (complete with a 1-command rollback to factory defaults and manufacturer hardware reset instructions).</p>



<h2 class="wp-block-heading">1. The Smoke: Wireless <code>Link OK</code>, IP Address <code>[Blank]</code></h2>



<p class="wp-block-paragraph">On the Brother HL-1210W, pressing the <strong>Power/Start button 3 times rapidly</strong> prints the internal 3-page <code>PRINTER SETTINGS</code> diagnostic report. Printing this report while the printer was turned on—yet completely unreachable on the network—revealed the exact state of the internal network card on Page 3 (<code>&lt;&lt;NETWORK CONFIGURATION&gt;&gt;</code>):</p>



<figure class="wp-block-image size-full"><a href="https://jonas.hopp.fr/wp-content/uploads/2026/11/brother_hl1210w_network_config_0000_bug.jpg"><img fetchpriority="high" decoding="async" width="768" height="1024" class="wp-image-566" src="https://jonas.hopp.fr/wp-content/uploads/2026/11/brother_hl1210w_network_config_0000_bug.jpg" alt="Brother HL-1210W Network Configuration Report showing Wireless Link OK on Channel 6 while IP Address is blank and IP Gateway is 0.0.0.0" srcset="https://jonas.hopp.fr/wp-content/uploads/2026/11/brother_hl1210w_network_config_0000_bug.jpg 768w, https://jonas.hopp.fr/wp-content/uploads/2026/11/brother_hl1210w_network_config_0000_bug-480x640.jpg 480w" sizes="(min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) 768px, 100vw" /></a>
<figcaption class="wp-element-caption">Page 3 of the Brother HL-1210W Network Configuration Report (printed via 3x Power button press): Layer-2 Wi-Fi is associated (green box: Link OK, 11n 72Mbps, Ch=6), while Layer-3 IPv4 has wiped its own IP and Subnet Mask to blank / 0.0.0.0 (red box).</figcaption>
</figure>



<p class="wp-block-paragraph">Here is the exact transcription of the diagnostic printout:</p>



<div class="jh-code-card">
<div class="jh-code-header"><span class="jh-code-title">PRINTER SETTINGS (3/3) — Diagnostic Extract <span class="jh-code-lang">TEXT</span></span> <button class="jh-copy-btn" type="button"> Copy code </button></div>
<pre class="jh-code-pre"><code id="code-diag-extract">&lt;Interface&gt;             WirelessLAN on
&lt;Node Type&gt;             Brother NC-8400w, IEEE 802.11b/g/n (Active)
&lt;Node Firmware Ver.&gt;    Firmware Ver.Q

&lt;IP Settings&gt;
IP Address                              (via DHCP)
Subnet Mask
IP Gateway              0.0.0.0
Boot Method             AUTO
Boot Tries              3
Primary DNS Server      192.168.3.1

&lt;Comm. Mode&gt;            Infrastructure
&lt;Authentication Mode&gt;   WPA/WPA2-PSK
&lt;Encryption Mode&gt;       AES
&lt;Wireless Link Status&gt;  Link OK, 11n(72Mbps), Receiving Signal=3, Operating Ch=6</code></pre>
</div>



<p class="wp-block-paragraph">Compare <code>&lt;Wireless Link Status&gt;</code> (green box) against <code>&lt;IP Settings&gt;</code> (red box):</p>



<ul class="wp-block-list">
<li><strong>Layer 2 (Wi-Fi 802.11n) is completely healthy:</strong> The printer is associated with the 2.4 GHz access point on Channel 6 at 72 Mbps (<code>Link OK</code>).</li>
<li><strong>Layer 3 (TCP/IPv4) has crashed and zeroed itself out:</strong> <code>IP Address</code> and <code>Subnet Mask</code> are literally blank, <code>IP Gateway</code> is <code>0.0.0.0</code>, while <code>Primary DNS Server</code> still holds <code>192.168.3.1</code> from its previous lease!</li>
</ul>



<h3 class="wp-block-heading">Why Does the Brother NC-8400w Wipe Its Own IP Address?</h3>



<p class="wp-block-paragraph">The Brother HL-1210W uses a 2.4 GHz-only (<code>802.11b/g/n</code>) radio paired with an embedded TCP/IP stack (<code>Firmware Ver.Q</code>). On modern dual-band or tri-band Wi-Fi 6 / Wi-Fi 7 routers, four things combine to break it:</p>



<ol class="wp-block-list">
<li><strong>Deep Sleep &amp; Dual-Band Radio Cycling / WPA2 Re-Keying:</strong> When the printer enters Deep Sleep, or when a modern router briefly steers bands or rotates WPA2 Group Temporal Keys (GTK) on the 2.4 GHz radio, the printer triggers a DHCP lease renewal or link renegotiation.</li>
<li><strong>The <code>Boot Tries: 3</code> Trap:</strong> By default, <code>Boot Method</code> is set to <code>AUTO</code> with <code>Boot Tries = 3</code>. If the printer&rsquo;s DHCP renewal (<code>DHCPDISCOVER</code> / <code>DHCPREQUEST</code>) does not complete within those 3 rapid attempts while the 2.4 GHz link is re-handshaking, the DHCP client gives up.</li>
<li><strong>Zeroing the Stack Without Retry:</strong> Even though <code>APIPA</code> is marked <code>Enabled</code>, instead of keeping its last valid lease or scheduling a background DHCP backoff timer, the <code>NC-8400w</code> zeroes out its IP address and subnet mask (<code>0.0.0.0</code>) and stays there indefinitely—associated to Wi-Fi at Layer 2, but unreachable on any IP port (<code>80</code>, <code>515</code>, <code>631</code>, <code>9100</code>) or via mDNS/NetBIOS.</li>
<li><strong>The 1-Hour <code>Auto Power Off</code> Default:</strong> Out of the box, the printer is also configured to trigger <code>Auto Power Off</code> after <strong>1 hour</strong> of inactivity, shutting down the network card instead of staying in low-power network standby (<code>Sleep</code>).</li>
</ol>



<h2 class="wp-block-heading">2. Another Culprit: Windows WSD (<code>Web Services for Devices</code>)</h2>



<p class="wp-block-paragraph">Even when the printer <em>does</em> have a valid IP address, Windows 10 and Windows 11 automatically register network printers on a <strong>WSD Port</strong> (<code>WSD-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx</code> pointing to <code>http://&lt;ip&gt;:80/WebServices/Device</code>).</p>



<p class="wp-block-paragraph">WSD relies on multicast discovery packets (<code>UDP 3702</code> / <code>WS-Discovery</code>). If your PC is connected to a 5 GHz or 6 GHz SSID and the printer is on the 2.4 GHz radio—or if the printer takes two seconds to wake from sleep when Windows queries it—Windows marks the WSD device as <strong><code>Offline</code></strong> and refuses to send the print job that would otherwise wake the printer up.</p>



<p class="wp-block-paragraph">Even if you manually create a Standard TCP/IP port in Windows, Windows enables <strong>SNMP Status Enabled</strong> by default (<code>UDP 161</code>). If the printer fails to answer an SNMP poll fast enough while sleeping, Windows <em>still</em> blocks the print queue as <code>Offline</code>.</p>



<h2 class="wp-block-heading">3. The Fix (Firmware NVRAM + Windows Print Stack)</h2>



<p class="wp-block-paragraph">To make a Brother Wi-Fi printer 100% reliable, we need to change <strong>three settings inside the printer&rsquo;s NVRAM</strong> (via its Embedded Web Server) and <strong>one setting in Windows</strong>:</p>



<figure class="wp-block-table">
<table>
<thead>
<tr>
<th>Layer / Component</th>
<th>Default (Buggy) Setting</th>
<th>Hardened Setting</th>
<th>Why It Fixes the Bug</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Printer TCP/IP Boot Method</strong></td>
<td><code>AUTO</code> (DHCP, <code>3</code> tries)</td>
<td><strong><code>STATIC</code></strong> (Fixed IP / Mask / Gateway)</td>
<td>Bypasses the buggy DHCP state machine so the printer never wipes its IP to <code>0.0.0.0</code> on wake-up or Wi-Fi re-keying.</td>
</tr>
<tr>
<td><strong>Printer DNS Method</strong></td>
<td><code>AUTO</code></td>
<td><strong><code>STATIC</code></strong> (Router IP + <code>1.1.1.1</code>)</td>
<td>Prevents DNS config drift when switching away from DHCP.</td>
</tr>
<tr>
<td><strong>Printer Auto Power Off</strong></td>
<td><code>1 hour</code></td>
<td><strong><code>Off</code></strong> (Uses <code>Sleep</code> mode instead)</td>
<td>Keeps the Wi-Fi card listening on TCP <code>9100</code> in low-power Sleep (~0.8W) instead of powering down after 60 minutes.</td>
</tr>
<tr>
<td><strong>Windows Print Port</strong></td>
<td><code>WSD-...</code> (Multicast)</td>
<td><strong><code>Standard TCP/IP</code></strong> (<code>RAW 9100</code>, <code>SNMP=False</code>)</td>
<td>Sends print streams directly to port <code>9100</code> and disables SNMP status polling so Windows never falsely flags the queue <code>Offline</code>.</td>
</tr>
</tbody>
</table>
</figure>



<h2 class="wp-block-heading">4. Automated 1-Command PowerShell Fixer &amp; Rollback Script (<code>Fix-BrotherPrinter.ps1</code>)</h2>



<p class="wp-block-paragraph">Instead of clicking through 20-year-old HTML frames in the printer&rsquo;s web interface and digging through legacy Windows Print Management dialogs, here is a standalone PowerShell script that automates both the <strong>printer NVRAM hardening</strong> and the <strong>Windows TCP/IP port migration</strong>—and includes a <code>-RevertToDefault</code> switch to roll everything back to factory defaults whenever you want.</p>



<h3 class="wp-block-heading">Step 0: If Your Printer Is Currently Stuck at <code>0.0.0.0</code></h3>



<ol class="wp-block-list">
<li><strong>Unplug the power cable</strong> from the back of the printer for 10 seconds, then plug it back in (tapping the soft power button only toggles Standby and does not reset the <code>NC-8400w</code> network stack).</li>
<li>Wait 30 seconds for it to boot and grab a fresh DHCP lease.</li>
<li>Look at the bottom of your 3x-Power-button Network Configuration printout to find your printer&rsquo;s admin password under <code>&lt;Default Password&gt; Pwd:</code> (or use <code>access</code> on older firmware).</li>
</ol>



<h3 class="wp-block-heading">Step 1: Run <code>Fix-BrotherPrinter.ps1</code> (Harden or Revert to Default)</h3>



<p class="wp-block-paragraph">Save the script below as <code>Fix-BrotherPrinter.ps1</code>:</p>



<p class="wp-block-paragraph"><strong>To apply the permanent hardening fix:</strong></p>



<div class="jh-code-card">
<div class="jh-code-header"><span class="jh-code-title">Apply Permanent Fix <span class="jh-code-lang">POWERSHELL</span></span> <button class="jh-copy-btn" type="button"> Copy code </button></div>
<pre class="jh-code-pre"><code id="code-ps1-cmd-harden">.\Fix-BrotherPrinter.ps1 -PrinterIP "192.168.3.8" -AdminPassword "YOUR_PRINTER_PASSWORD"</code></pre>
</div>



<p class="wp-block-paragraph"><strong>To revert all printer &amp; Windows settings back to factory defaults (<code>-RevertToDefault</code>):</strong></p>



<div class="jh-code-card">
<div class="jh-code-header"><span class="jh-code-title">Revert to Factory Defaults <span class="jh-code-lang">POWERSHELL</span></span> <button class="jh-copy-btn" type="button"> Copy code </button></div>
<pre class="jh-code-pre"><code id="code-ps1-cmd-revert">.\Fix-BrotherPrinter.ps1 -PrinterIP "192.168.3.8" -AdminPassword "YOUR_PRINTER_PASSWORD" -RevertToDefault</code></pre>
</div>



<p class="wp-block-paragraph"><strong>Full PowerShell Script (<code>Fix-BrotherPrinter.ps1</code>):</strong></p>



<div class="jh-code-card">
<div class="jh-code-header"><span class="jh-code-title">Fix-BrotherPrinter.ps1 <span class="jh-code-lang">POWERSHELL</span></span> <button class="jh-copy-btn" type="button"> Copy code </button></div>
<pre class="jh-code-pre"><code id="code-ps1-full">&lt;#
.SYNOPSIS
    Permanent Network &amp; Windows Print Stack Fixer (and Rollback Tool) for Brother HL-1210W / NC-8400w Printers.

.DESCRIPTION
    Resolves (or reverts) the two root causes of Brother wireless printers randomly showing "Offline":
    1. Embedded Firmware Bug (Brother NC-8400w / HL-1210W):
       - Default Mode: Locks Boot Method to STATIC, sets Static DNS, and disables 1-hour Auto Power Off
         so the printer stays in low-power Sleep mode with its Wi-Fi stack active.
       - Revert Mode (-RevertToDefault): Restores Boot Method to AUTO (DHCP), Boot Tries to 3, DNS Method
         to AUTO, and Auto Power Off to 1 hour.
    2. Windows Print Stack:
       - Default Mode: Creates a Standard TCP/IP Port (RAW 9100, SNMP=False) and binds the Brother queue.
       - Revert Mode (-RevertToDefault): Rebinds the Windows print queue back to its WSD port (if present).

.PARAMETER PrinterIP
    The IPv4 address of the Brother printer (e.g., 192.168.3.8).

.PARAMETER AdminPassword
    The printer's Embedded Web Server password (printed at the bottom of the 3x Power-button Network
    Configuration Report under "&lt;Default Password&gt; Pwd:", or "access" on older firmware).

.PARAMETER RevertToDefault
    Switch to restore the printer's network settings and Windows port back to factory defaults.

.EXAMPLE
    .\Fix-BrotherPrinter.ps1 -PrinterIP "192.168.3.8" -AdminPassword "YOUR_PRINTER_PASSWORD"

.EXAMPLE
    .\Fix-BrotherPrinter.ps1 -PrinterIP "192.168.3.8" -AdminPassword "YOUR_PRINTER_PASSWORD" -RevertToDefault
#&gt;
[CmdletBinding()]
param(
    [Parameter(Mandatory = $true, HelpMessage = "IPv4 address of the Brother printer")]
    [ValidatePattern('^\d{1,3}(\.\d{1,3}){3}$')]
    [string]$PrinterIP,

    [Parameter(Mandatory = $true, HelpMessage = "Admin password from the printer's Network Config page (or 'access')")]
    [string]$AdminPassword,

    [string]$SubnetMask = "255.255.255.0",
    [string]$Gateway = "",
    [string]$PrimaryDNS = "",
    [string]$SecondaryDNS = "1.1.1.1",
    [string]$PrinterName = "",

    [switch]$RevertToDefault
)

$ErrorActionPreference = "Stop"

$octets = $PrinterIP.Split('.')
if ([string]::IsNullOrWhiteSpace($Gateway)) {
    $Gateway = "$($octets[0]).$($octets[1]).$($octets[2]).1"
}
if ([string]::IsNullOrWhiteSpace($PrimaryDNS)) {
    $PrimaryDNS = $Gateway
}

Write-Host "`n==================================================================" -ForegroundColor Cyan
if ($RevertToDefault) {
    Write-Host " Brother HL-1210W / NC-8400w — Factory Default Rollback" -ForegroundColor Yellow
} else {
    Write-Host " Brother HL-1210W / NC-8400w — Network &amp; Windows Stack Hardener" -ForegroundColor Cyan
}
Write-Host "==================================================================`n" -ForegroundColor Cyan

# ---------------------------------------------------------------------------
# STEP 1: Verify Network Reachability
# ---------------------------------------------------------------------------
Write-Host "[1/3] Checking connectivity to $PrinterIP..." -ForegroundColor Cyan
if (-not (Test-Connection -ComputerName $PrinterIP -Count 2 -Quiet -ErrorAction SilentlyContinue)) {
    throw "Printer at $PrinterIP is unreachable. Unplug its power cord for 10 seconds, plug it back in, wait 30s, and re-run."
}
Write-Host "  [+] Printer is reachable at $PrinterIP." -ForegroundColor Green

# ---------------------------------------------------------------------------
# STEP 2: Authenticate to Brother Embedded Web Server (EWS)
# ---------------------------------------------------------------------------
Write-Host "[2/3] Authenticating to Brother Embedded Web Server (http://$PrinterIP)..." -ForegroundColor Cyan
$statusUrl = "http://$PrinterIP/general/status.html"
$r1 = Invoke-WebRequest -Uri $statusUrl -SessionVariable ews -UseBasicParsing -TimeoutSec 10

if ($r1.Content -match 'type="password"[^&gt;]*name="([^"]+)"') {
    $pwdField = $matches[1]
} else {
    throw "Could not detect login password field on $statusUrl."
}

$rLogin = Invoke-WebRequest -Uri $statusUrl -Method Post -WebSession $ews -UseBasicParsing -TimeoutSec 10 -Body @{
    $pwdField  = $AdminPassword
    "loginurl" = "/general/status.html"
}
if ($rLogin.Content -notmatch '/net/net/net\.html') {
    throw "Authentication failed. Check the password printed at the bottom of your 3x-Power-button Network Config report."
}
Write-Host "  [+] Authenticated successfully (field: $pwdField)." -ForegroundColor Green

if (-not $RevertToDefault) {
    # --- HARDEN MODE ---
    # 1. Lock TCP/IP Wireless Boot Method to STATIC (B128 = 7)
    Invoke-WebRequest -Uri "http://$PrinterIP/net/wireless/tcpip.html" -Method Post -WebSession $ews -UseBasicParsing -TimeoutSec 10 -Body @{
        pageid = "250"; transition = "0"
        B124 = "1"; B125 = $PrinterIP; B126 = $SubnetMask; B127 = $Gateway
        B128 = "7"; B129 = "1"; B1f9 = "0"
    } | Out-Null
    Write-Host "  [+] Boot Method locked to STATIC ($PrinterIP / $SubnetMask / GW $Gateway)." -ForegroundColor Green

    # 2. Lock DNS Server Method to STATIC (B139 = 1) &amp; Boot Tries = 5
    Invoke-WebRequest -Uri "http://$PrinterIP/net/wireless/tcpip_detail.html" -Method Post -WebSession $ews -UseBasicParsing -TimeoutSec 10 -Body @{
        pageid = "251"; B147 = "5"; B14b = "5"
        B139 = "1"; B14c = $PrimaryDNS; B14d = $SecondaryDNS; B14e = "21"
    } | Out-Null
    Write-Host "  [+] DNS locked to STATIC ($PrimaryDNS, $SecondaryDNS)." -ForegroundColor Green

    # 3. Disable 1-Hour Auto Power Off (B1f8 = 0) so Sleep Mode keeps Wi-Fi alive
    Invoke-WebRequest -Uri "http://$PrinterIP/general/powerdown.html" -Method Post -WebSession $ews -UseBasicParsing -TimeoutSec 10 -Body @{
        pageid = "6"; postif_registration_reject = "1"; B1f8 = "0"
    } | Out-Null
    Write-Host "  [+] Auto Power Off disabled (low-power Sleep stays active)." -ForegroundColor Green

    # 4. Windows Standard TCP/IP Port (RAW 9100, SNMP=False)
    Write-Host "[3/3] Migrating Windows Print Queue from WSD to Standard TCP/IP (RAW 9100, SNMP=False)..." -ForegroundColor Cyan
    $portName = "IP_$PrinterIP"
    if (-not (Get-PrinterPort -Name $portName -ErrorAction SilentlyContinue)) {
        Add-PrinterPort -Name $portName -PrinterHostAddress $PrinterIP -PortNumber 9100
    }
    $printer = if ($PrinterName) {
        Get-Printer -Name $PrinterName -ErrorAction SilentlyContinue
    } else {
        Get-Printer | Where-Object { $_.Name -like "*Brother*" -or $_.DriverName -like "*Brother*" } | Select-Object -First 1
    }
    if ($printer) {
        Set-Printer -Name $printer.Name -PortName $portName
        Write-Host "  [+] Bound '$($printer.Name)' to '$portName' (RAW 9100, SNMP=False)." -ForegroundColor Green
    }
    Write-Host "`nDone! Your Brother printer is permanently hardened.`n" -ForegroundColor Cyan

} else {
    # --- REVERT TO DEFAULT MODE ---
    # 1. Restore TCP/IP Wireless Boot Method to AUTO (B128 = 0)
    Invoke-WebRequest -Uri "http://$PrinterIP/net/wireless/tcpip.html" -Method Post -WebSession $ews -UseBasicParsing -TimeoutSec 10 -Body @{
        pageid = "250"; transition = "0"
        B124 = "1"; B125 = $PrinterIP; B126 = $SubnetMask; B127 = $Gateway
        B128 = "0"; B129 = "1"; B1f9 = "0"
    } | Out-Null
    Write-Host "  [+] Restored Boot Method to AUTO (DHCP + APIPA)." -ForegroundColor Yellow

    # 2. Restore DNS Server Method to AUTO (B139 = 2) &amp; Boot Tries = 3
    Invoke-WebRequest -Uri "http://$PrinterIP/net/wireless/tcpip_detail.html" -Method Post -WebSession $ews -UseBasicParsing -TimeoutSec 10 -Body @{
        pageid = "251"; B147 = "3"; B14b = "5"
        B139 = "2"; B14c = $PrimaryDNS; B14d = "0.0.0.0"; B14e = "21"
    } | Out-Null
    Write-Host "  [+] Restored DNS Server Method to AUTO (Boot Tries = 3)." -ForegroundColor Yellow

    # 3. Restore Auto Power Off to 1 hour (B1f8 = 1)
    Invoke-WebRequest -Uri "http://$PrinterIP/general/powerdown.html" -Method Post -WebSession $ews -UseBasicParsing -TimeoutSec 10 -Body @{
        pageid = "6"; postif_registration_reject = "1"; B1f8 = "1"
    } | Out-Null
    Write-Host "  [+] Restored Auto Power Off to default (1 hour)." -ForegroundColor Yellow

    # 4. Rebind Windows Printer to WSD Port if available
    Write-Host "[3/3] Reverting Windows Print Queue Port..." -ForegroundColor Cyan
    $wsdPort = Get-PrinterPort | Where-Object { $_.Name -like "WSD-*" } | Select-Object -First 1
    $printer = if ($PrinterName) {
        Get-Printer -Name $PrinterName -ErrorAction SilentlyContinue
    } else {
        Get-Printer | Where-Object { $_.Name -like "*Brother*" -or $_.DriverName -like "*Brother*" } | Select-Object -First 1
    }
    if ($printer -and $wsdPort) {
        Set-Printer -Name $printer.Name -PortName $wsdPort.Name
        Write-Host "  [+] Rebound '$($printer.Name)' back to WSD port '$($wsdPort.Name)'." -ForegroundColor Yellow
    } else {
        Write-Host "  [i] Kept current Windows port (no WSD port found to revert to)." -ForegroundColor Gray
    }
    Write-Host "`nRollback complete! Printer settings are back to factory defaults.`n" -ForegroundColor Yellow
}</code></pre>
</div>



<h2 class="wp-block-heading">5. Cross-Platform Python 3 Script (Harden &amp; Revert for Linux / macOS / Windows)</h2>



<p class="wp-block-paragraph">If you use Linux or macOS—or want to harden or revert the printer&rsquo;s firmware directly from a home server without PowerShell—here is the zero-dependency Python 3 equivalent (<code>fix_brother_printer.py</code>):</p>



<div class="jh-code-card">
<div class="jh-code-header"><span class="jh-code-title">Harden via Python 3 <span class="jh-code-lang">BASH</span></span> <button class="jh-copy-btn" type="button"> Copy code </button></div>
<pre class="jh-code-pre"><code id="code-py-cmd-harden">python3 fix_brother_printer.py 192.168.3.8 "YOUR_PRINTER_PASSWORD"</code></pre>
</div>



<div class="jh-code-card">
<div class="jh-code-header"><span class="jh-code-title">Revert to Defaults via Python 3 <span class="jh-code-lang">BASH</span></span> <button class="jh-copy-btn" type="button"> Copy code </button></div>
<pre class="jh-code-pre"><code id="code-py-cmd-revert">python3 fix_brother_printer.py 192.168.3.8 "YOUR_PRINTER_PASSWORD" --revert</code></pre>
</div>



<div class="jh-code-card">
<div class="jh-code-header"><span class="jh-code-title">fix_brother_printer.py <span class="jh-code-lang">PYTHON 3</span></span> <button class="jh-copy-btn" type="button"> Copy code </button></div>
<pre class="jh-code-pre"><code id="code-py-full">#!/usr/bin/env python3
"""
Harden (or Revert to Default) Brother HL-1210W / NC-8400w Embedded Network Stack via HTTP.

Usage:
  Harden: python3 fix_brother_printer.py 192.168.3.8 YOUR_ADMIN_PASSWORD
  Revert: python3 fix_brother_printer.py 192.168.3.8 YOUR_ADMIN_PASSWORD --revert
"""
import argparse
import http.cookiejar
import re
import sys
import urllib.parse
import urllib.request


def configure_brother(
    ip: str,
    password: str,
    netmask: str = "255.255.255.0",
    gw: str = "",
    revert: bool = False,
) -&gt; None:
    gw = gw or ".".join(ip.split(".")[:3] + ["1"])
    cj = http.cookiejar.CookieJar()
    opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))

    # 1. Discover dynamic password input field name &amp; authenticate
    status_url = f"http://{ip}/general/status.html"
    html = opener.open(status_url, timeout=10).read().decode("latin1")
    match = re.search(r'type="password"[^&gt;]*name="([^"]+)"', html)
    if not match:
        raise RuntimeError(f"Could not find login password field on {status_url}")
    pwd_field = match.group(1)

    login_data = urllib.parse.urlencode(
        {pwd_field: password, "loginurl": "/general/status.html"}
    ).encode("utf-8")
    res = opener.open(status_url, data=login_data, timeout=10).read().decode("latin1")
    if "/net/net/net.html" not in res:
        raise RuntimeError("Authentication failed: check your printer admin password.")

    if not revert:
        # --- HARDEN MODE ---
        # Lock Boot Method = STATIC (7)
        tcp_data = urllib.parse.urlencode({
            "pageid": "250", "transition": "0", "B124": "1",
            "B125": ip, "B126": netmask, "B127": gw,
            "B128": "7", "B129": "1", "B1f9": "0",
        }).encode("utf-8")
        opener.open(f"http://{ip}/net/wireless/tcpip.html", data=tcp_data, timeout=10)

        # Lock DNS Server Method = STATIC (1) &amp; Boot Tries = 5
        dns_data = urllib.parse.urlencode({
            "pageid": "251", "B147": "5", "B14b": "5",
            "B139": "1", "B14c": gw, "B14d": "1.1.1.1", "B14e": "21",
        }).encode("utf-8")
        opener.open(f"http://{ip}/net/wireless/tcpip_detail.html", data=dns_data, timeout=10)

        # Disable 1-Hour Auto Power Off (B1f8 = 0) to keep low-power Sleep active
        pwr_data = urllib.parse.urlencode({
            "pageid": "6", "postif_registration_reject": "1", "B1f8": "0",
        }).encode("utf-8")
        opener.open(f"http://{ip}/general/powerdown.html", data=pwr_data, timeout=10)
        print(f"[+] Hardened Brother printer at {ip} (Boot=STATIC, DNS=STATIC, AutoPowerOff=Off).")
    else:
        # --- REVERT TO FACTORY DEFAULTS MODE ---
        # Restore Boot Method = AUTO (0)
        tcp_data = urllib.parse.urlencode({
            "pageid": "250", "transition": "0", "B124": "1",
            "B125": ip, "B126": netmask, "B127": gw,
            "B128": "0", "B129": "1", "B1f9": "0",
        }).encode("utf-8")
        opener.open(f"http://{ip}/net/wireless/tcpip.html", data=tcp_data, timeout=10)

        # Restore DNS Server Method = AUTO (2) &amp; Boot Tries = 3
        dns_data = urllib.parse.urlencode({
            "pageid": "251", "B147": "3", "B14b": "5",
            "B139": "2", "B14c": gw, "B14d": "0.0.0.0", "B14e": "21",
        }).encode("utf-8")
        opener.open(f"http://{ip}/net/wireless/tcpip_detail.html", data=dns_data, timeout=10)

        # Restore Auto Power Off = 1 hour (B1f8 = 1)
        pwr_data = urllib.parse.urlencode({
            "pageid": "6", "postif_registration_reject": "1", "B1f8": "1",
        }).encode("utf-8")
        opener.open(f"http://{ip}/general/powerdown.html", data=pwr_data, timeout=10)
        print(f"[+] Reverted Brother printer at {ip} to factory defaults (Boot=AUTO, DNS=AUTO, AutoPowerOff=1h).")


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Harden or revert Brother HL-1210W / NC-8400w network settings.")
    parser.add_argument("ip", help="IPv4 address of the Brother printer (e.g. 192.168.3.8)")
    parser.add_argument("password", help="Printer EWS Admin password (or 'access')")
    parser.add_argument("--netmask", default="255.255.255.0", help="Subnet mask (default: 255.255.255.0)")
    parser.add_argument("--gateway", default="", help="Gateway IP (default: .1 of printer subnet)")
    parser.add_argument("--revert", action="store_true", help="Revert printer settings back to factory defaults")
    args = parser.parse_args()
    configure_brother(args.ip, args.password, args.netmask, args.gateway, args.revert)</code></pre>
</div>



<h2 class="wp-block-heading">6. Reset the Network Settings to the Factory Default (Manufacturer Procedure)</h2>



<p class="wp-block-paragraph">What if you move to a new house, replace your router with a different subnet (for example switching from <code>192.168.3.x</code> to <code>192.168.1.x</code>), and forgot to run <code>-RevertToDefault</code> / <code>--revert</code> beforehand?</p>



<p class="wp-block-paragraph">Per Brother&rsquo;s official documentation, you can use your machine&rsquo;s <strong>Power On/Off</strong> button to reset the print server to its default factory settings. This resets all network information, such as the password and IP address (you can also reset the print server to its factory settings using <strong>BRAdmin Light</strong>, <strong>BRAdmin Professional 3</strong>, or <strong>Web Based Management</strong>):</p>



<ol class="wp-block-list">
<li>Make sure the power cord is plugged in, the top cover is closed, and the machine is <strong>turned off</strong>.</li>
<li><strong>While holding down <code>Power On/Off</code></strong>, <strong>open and close the top cover</strong>.</li>
<li><strong>Release <code>Power On/Off</code></strong>. Make sure that all the LEDs turn off.</li>
<li><strong>Press <code>Power On/Off</code> six times</strong>.</li>
<li>The machine will restart automatically with its network settings restored to factory defaults.</li>
</ol>



<h3 class="wp-block-heading">Pro-Tip: Add a DHCP Lease Reservation on Your Router Too</h3>



<p class="wp-block-paragraph">Even though the printer now uses <code>Boot Method = STATIC</code> in its NVRAM, it is good practice to also bind its MAC address to that IP address in your router&rsquo;s DHCP table (or choose an IP outside your router&rsquo;s dynamic DHCP pool) so the router never assigns that address to another device while the printer is powered off.</p>

<p>&nbsp;</p>]]></content:encoded>
					
					<wfw:commentRss>https://jonas.hopp.fr/why-your-brother-wi-fi-printer-shows-offline-when-turned-on-the-0-0-0-0-dhcp-bug-and-a-1-click-fix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to redirect an url to another one to be more productive, or anything else.</title>
		<link>https://jonas.hopp.fr/how-to-redirect-an-url-to-another-one-to-be-more-productive-or-anything-else/</link>
					<comments>https://jonas.hopp.fr/how-to-redirect-an-url-to-another-one-to-be-more-productive-or-anything-else/#respond</comments>
		
		<dc:creator><![CDATA[Jonas Hopp]]></dc:creator>
		<pubDate>Mon, 17 Sep 2018 10:42:18 +0000</pubDate>
				<category><![CDATA[Technique]]></category>
		<category><![CDATA[Tips et autres astuces]]></category>
		<category><![CDATA[Web]]></category>
		<guid isPermaLink="false">https://jonas.hopp.fr/?p=334</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[<p><div class="et_pb_section et_pb_section_0 et_section_regular" >
				
				
				
				
				
				
				<div class="et_pb_row et_pb_row_0">
				<div class="et_pb_column et_pb_column_4_4 et_pb_column_0  et_pb_css_mix_blend_mode_passthrough et-last-child">
				
				
				
				
				<div class="et_pb_module et_pb_text et_pb_text_0  et_pb_text_align_left et_pb_bg_layout_light">
				
				
				
				
				<div class="et_pb_text_inner"><p>I was searching for a solution to redirect an url to another one to be more productive, or switch webapp tools easily without thinking about it.</p>
<p>First, I tried editing hosts file (windows only solution), but the thing is you can only redirect to an IP. It&rsquo;s not so convenient!</p>
<p>I suggest you to try, instead of editing the hosts file in windows, to use a plugin like <a href="https://addons.mozilla.org/fr/firefox/addon/redirector/">Redirector for Firefox</a> or <a href="https://chrome.google.com/webstore/detail/redirector/pajiegeliagebegjdhebejdlknciafen">Redirector for Chrome</a>.</p>
<p>It&rsquo;s working great to keep me from browsing some websites when I don&rsquo;t want, in exemple for productivity purposes, or to force myself to use a new service. One could imagine using a redirector to stop using hotmail.com and use any another custom service, without changing any other habits.</p></div>
			</div>
			</div>
				
				
				
				
			</div>
				
				
			</div></p>
]]></content:encoded>
					
					<wfw:commentRss>https://jonas.hopp.fr/how-to-redirect-an-url-to-another-one-to-be-more-productive-or-anything-else/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>1&#038;1 nom de domaine avec un hébergement chez OVH</title>
		<link>https://jonas.hopp.fr/11-nom-de-domaine-avec-un-hebergement-chez-ovh/</link>
					<comments>https://jonas.hopp.fr/11-nom-de-domaine-avec-un-hebergement-chez-ovh/#comments</comments>
		
		<dc:creator><![CDATA[Jonas Hopp]]></dc:creator>
		<pubDate>Thu, 13 Jul 2017 20:51:21 +0000</pubDate>
				<category><![CDATA[Technique]]></category>
		<category><![CDATA[Web]]></category>
		<guid isPermaLink="false">https://jonas.hopp.fr/?p=200</guid>

					<description><![CDATA[Un billet très court, pour une information qui n’apparaissait nulle part sur les internets en 2017. Pour lier le nom de domaine 1&#38;1 (1and1) à un hébergement OVH en multi-site, il faut, sur l&#8217;interface de 1&#38;1, créer un sous-domaine « ovhcontrol », puis éditer la zone DNS de ce sous-domaine dans l&#8217;interface 1&#38;1. Sans ça il est [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Un billet très court, pour une information qui n’apparaissait nulle part sur les internets en 2017.</p>
<p>Pour lier le nom de domaine 1&amp;1 (1and1) à un hébergement OVH en multi-site, il faut, sur l&rsquo;interface de 1&amp;1, créer un sous-domaine « ovhcontrol », puis éditer la zone DNS de ce sous-domaine dans l&rsquo;interface 1&amp;1.</p>
<p>Sans ça il est impossible de rajouter la clef OVH avec le sous-domaine OVHCONTROL directement, car 1&amp;1 interdit l&rsquo;ajout de zone TXT pour un sous-domaine sur le domaine « principal ».</p>
<p>En espérant que j&rsquo;en aiderai un ou deux.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jonas.hopp.fr/11-nom-de-domaine-avec-un-hebergement-chez-ovh/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
