PowerShell Gallery | GitHub Releases | Report an Issue
A lightweight, read-only Windows WPF GUI for inspecting live iptables NAT rules (PREROUTING, POSTROUTING, VSERVER) on ASUS (Asuswrt / Asuswrt-Merlin) routers over SSH.
- Read-Only Inspection: Queries
iptables -t nat -L <CHAIN> -v -n -xover SSH without modifying router firewall state. - Live Search Filter: Filters across all columns (ports, IP addresses, targets, interfaces, and rule details) in real time as you type.
- Native Dark & Light Themes: Automatically detects your Windows 10/11 app theme (including native DWM dark title bars) or accepts manual
Dark/Lightoverrides. - Exact Packet & Byte Counters: Displays unrounded packet and byte totals for verifying port forwards and custom NAT redirects.
- Windows 10 or Windows 11 with PowerShell 5.1 or PowerShell 7+.
- Windows OpenSSH Client (
ssh.exeavailable in your systemPATH). - ASUS Router running stock Asuswrt or Asuswrt-Merlin firmware.
Because AsusNatView.ps1 connects non-interactively (BatchMode=yes), you need an SSH key pair on your PC and your public key added to your router.
Open PowerShell and run the following commands to create the .ssh directory (if it does not exist) and generate an Ed25519 key pair:
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.ssh" | Out-Null
ssh-keygen -t ed25519 -f "$env:USERPROFILE\.ssh\id_ed25519" -N ""Note: Leaving the passphrase empty (
-N "") allowsAsusNatView.ps1to connect automatically without prompting. If you prefer a passphrase-protected key, load it into the Windowsssh-agentservice first.
Copy your new public key to the Windows clipboard:
Get-Content "$env:USERPROFILE\.ssh\id_ed25519.pub" | Set-Clipboard- Log into your ASUS router's web interface (
http://192.168.50.1orhttp://router.asus.com). - Navigate to Administration > System.
- Under the Service section, set Enable SSH to LAN only.
Security Note: Always select LAN only—never LAN & WAN—so SSH is never exposed to the public internet.
- Set Allow SSH password login to No (optional, recommended once key login is verified).
- Paste your copied
id_ed25519.pubkey (a single line starting withssh-ed25519 ...) into the Authorized Keys box. - Click Apply at the bottom of the page.
Connect once manually in PowerShell so OpenSSH saves your router's fingerprint to $env:USERPROFILE\.ssh\known_hosts:
ssh -i "$env:USERPROFILE\.ssh\id_ed25519" admin@192.168.50.1Type yes when prompted to continue connecting, then type exit to close the session.
Install directly from the PowerShell Gallery:
Install-Script -Name AsusNatViewTo update an existing installation to the latest version:
Update-Script -Name AsusNatViewDownload AsusNatView.ps1 from the Releases page and save it to your preferred scripts directory.
Edit the # --- Configuration --- section at the top of AsusNatView.ps1 to match your router and SSH key setup:
# --- Configuration ---
$RouterIP = "192.168.50.1"
$User = "admin"
$KeyPath = "$env:USERPROFILE\.ssh\id_ed25519"
$DeviceLabel = "ASUS Router"
$Chains = @("PREROUTING", "POSTROUTING", "VSERVER")
$DefaultChain = "PREROUTING"
$Theme = "Auto" # Options: "Auto", "Dark", "Light"| Variable | Default | Description |
|---|---|---|
$RouterIP |
"192.168.50.1" |
IP address or hostname of your ASUS router |
$User |
"admin" |
Router SSH login username |
$KeyPath |
"$env:USERPROFILE\.ssh\id_ed25519" |
Path to your OpenSSH private key file |
$DeviceLabel |
"ASUS Router" |
Router name displayed in the window title and error dialogs |
$Chains |
@("PREROUTING", "POSTROUTING", "VSERVER") |
iptables NAT chains shown in the dropdown selector |
$DefaultChain |
"PREROUTING" |
Initial NAT chain loaded when the window opens |
$Theme |
"Auto" |
UI color scheme ("Auto", "Dark", or "Light") |
If installed via Install-Script (and your PowerShell Scripts folder is in PATH):
AsusNatView.ps1Or run directly from a local folder:
.\AsusNatView.ps1You can launch AsusNatView.ps1 directly from your Desktop without leaving a PowerShell console window open in the background.
For an easy point-and-click setup, download PowerShell Desktop Shortcut Creator from GitHub (also available on the PowerShell Gallery via Install-Script -Name create_desktop_shortcut). It gives you a dark-mode GUI to browse for AsusNatView.ps1, enable windowless background execution, choose PowerShell 5.1 or 7.x, and pick a Windows system icon automatically.
- Locate your script path:
- If you downloaded
AsusNatView.ps1manually, note its full path (for example,C:\Scripts\AsusNatView.ps1). - If you installed it via
Install-Script, run the following in PowerShell to get its exact path:(Get-Command AsusNatView.ps1).Source
- If you downloaded
- Right-click an empty area on your Desktop and select New > Shortcut.
- In the Type the location of the item box, enter the following command (replacing
C:\Path\To\AsusNatView.ps1with your actual path):powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Path\To\AsusNatView.ps1" - Click Next, type
AsusNatViewas the shortcut name, and click Finish. - (Optional) To assign a network icon, right-click the shortcut, select Properties > Change Icon..., enter
%SystemRoot%\System32\netshell.dll(orshell32.dll), choose an icon, and click OK.
Run this snippet in PowerShell to create the shortcut on your Desktop automatically (if you downloaded the script manually, replace "C:\Path\To\AsusNatView.ps1" with your saved file path):
$ScriptPath = (Get-Command AsusNatView.ps1 -ErrorAction SilentlyContinue).Source
if (-not $ScriptPath) {$ScriptPath = "C:\Path\To\AsusNatView.ps1" }
$WshShell = New-Object -ComObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$env:USERPROFILE\Desktop\AsusNatView.lnk")
$Shortcut.TargetPath = "powershell.exe"
$Shortcut.Arguments = "-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File `"$ScriptPath`""
$Shortcut.WorkingDirectory = Split-Path -Path$ScriptPath -Parent
$Shortcut.IconLocation = "$env:SystemRoot\System32\netshell.dll,0"
$Shortcut.Description = "Inspect live iptables NAT rules on ASUS routers"
$Shortcut.Save()- Type in Filter box: Filter displayed rules in real time
- F5: Refresh packet and byte counters for the selected chain
- Esc: Close the window
- SSH is disabled on the router: Verify Enable SSH is set to LAN only under Administration > System and that you clicked Apply.
- Wrong router IP address: Newer ASUS models default to
192.168.50.1, while older models or custom subnets often use192.168.1.1. Update$RouterIPin the Configuration section to match your gateway IP. - Custom SSH port: If you changed the router's SSH port away from
22, add-p <port>to thesshcommand insideGet-NatRules.
- Because
AsusNatView.ps1runs OpenSSH with-o BatchMode=yes, it cannot answer interactive fingerprint prompts. - Fix: Run
ssh -i "$env:USERPROFILE\.ssh\id_ed25519" admin@192.168.50.1once manually in PowerShell, typeyesto trust the host key, and exit.
- Verify your username: ASUS routers let you customize the web UI login username during initial setup. Ensure
$Usermatches the exact admin username configured on your router (it may not beadmin). - Check your key paths:
$KeyPathinAsusNatView.ps1must point to your private key file (id_ed25519), while the contents of your public key file (id_ed25519.pub) must be pasted into Administration > System > Authorized Keys on the router. - Key has a passphrase: If you created the key with a passphrase instead of
-N "",BatchMode=yeswill reject it unless the key is loaded into the Windowsssh-agentservice (Start-Service ssh-agent; ssh-add "$env:USERPROFILE\.ssh\id_ed25519").
- The built-in Windows OpenSSH Client is not installed or enabled. Open Windows Settings > System > Optional features, click Add an optional feature, and install OpenSSH Client (or run
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0in an elevated PowerShell prompt).
VSERVERis an Asuswrt / Asuswrt-Merlin chain used for port forwarding (Virtual Server). If you are querying a non-ASUS Linux router that lacks aVSERVERchain, remove"VSERVER"from the$Chainsarray in the Configuration block.- If the window opens with
0rows, no active NAT or port-forwarding rules are currently configured in that chain.
- If Windows blocks local scripts from running, allow locally created scripts for your user account:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
MIT License