{"id":32662609,"url":"https://github.com/ismaolen/wsl2-hyperv-firewall","last_synced_at":"2026-04-15T14:02:45.950Z","repository":{"id":319006893,"uuid":"1077223891","full_name":"Ismaolen/wsl2-hyperv-firewall","owner":"Ismaolen","description":"One-liner: Manage Hyper-V firewall rules from WSL for ROS/ROS2 (DDS, TCP/UDP/ICMP) – safe, scoped, CLI.","archived":false,"fork":false,"pushed_at":"2025-10-17T00:19:56.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-17T04:01:27.164Z","etag":null,"topics":["cli","command-line-tool","dds","dds-discovery","firewall","hyper-v","network-automation-python","networking","powershell","python","robotics","ros","ros2","windows","windows-firewall","windows-subsystem-for-linux","wsl","wsl2"],"latest_commit_sha":null,"homepage":"https://ismaolen.github.io/wsl2-hyperv-firewall/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ismaolen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-16T00:45:59.000Z","updated_at":"2025-10-17T00:20:00.000Z","dependencies_parsed_at":"2025-10-17T18:13:06.360Z","dependency_job_id":"c6cf976a-a72b-40d6-a883-448de3dcdb36","html_url":"https://github.com/Ismaolen/wsl2-hyperv-firewall","commit_stats":null,"previous_names":["ismaolen/wsl2-hyperv-firewall"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Ismaolen/wsl2-hyperv-firewall","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismaolen%2Fwsl2-hyperv-firewall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismaolen%2Fwsl2-hyperv-firewall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismaolen%2Fwsl2-hyperv-firewall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismaolen%2Fwsl2-hyperv-firewall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ismaolen","download_url":"https://codeload.github.com/Ismaolen/wsl2-hyperv-firewall/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismaolen%2Fwsl2-hyperv-firewall/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282049664,"owners_count":26605488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","command-line-tool","dds","dds-discovery","firewall","hyper-v","network-automation-python","networking","powershell","python","robotics","ros","ros2","windows","windows-firewall","windows-subsystem-for-linux","wsl","wsl2"],"created_at":"2025-10-31T20:00:56.251Z","updated_at":"2025-10-31T20:02:00.075Z","avatar_url":"https://github.com/Ismaolen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WSL2 Hyper-V Firewall (CLI)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://ismaolen.github.io/wsl2-hyperv-firewall/\"\u003eLive Demo\u003c/a\u003e ·\n  \u003ca href=\"#quick-start\"\u003eQuick start\u003c/a\u003e ·\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e ·\n  \u003ca href=\"#notes\"\u003eNotes\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Ismaolen/wsl2-hyperv-firewall/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-informational\" alt=\"License\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Platform-WSL2%20%7C%20Windows-blue\" alt=\"Platform\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/ROS-ROS1%2FROS2-6aa84f\" alt=\"ROS\"\u003e\n  \u003cimg src=\"https://img.shields.io/github/last-commit/Ismaolen/wsl2-hyperv-firewall\" alt=\"Last commit\"\u003e\n  \u003ca href=\"https://github.com/Ismaolen/wsl2-hyperv-firewall/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/Ismaolen/wsl2-hyperv-firewall?style=social\" alt=\"Stars\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"docs/assets/wsl_hyperv_firewall.gif\"\u003e\n    \u003cimg src=\"docs/assets/wsl_hyperv_firewall.gif\" alt=\"Demo GIF\" width=\"720\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\nManage Windows **Hyper-V** firewall rules from **WSL**. One command to create/search/delete TCP/UDP/ICMP rules for specific IPs — no GUI, no guesswork.\n\n\u003e Script: `wsl_ros2_hv_firewall.py` (run inside WSL; it calls `powershell.exe` on Windows)\n\n---\n\n## Why this is useful (ROS / ROS 2)\n\nIf your robot is on the LAN and your nodes run in **WSL2**, Windows’ Hyper-V firewall often blocks:\n\n* **ROS 2 DDS discovery** (multicast/broadcast over UDP)\n* **ROS 1 master / services** (TCP ports like `11311`)\n* Simple reachability (**ICMP/ping**)\n\nThis tool opens the right paths between **WSL ↔ Windows ↔ your robot’s IP(s)** so discovery works, topics show up, and connections stop timing out — without disabling the firewall or allowing the whole subnet.\n\n---\n\n## Networking note (required for ROS)\n\nEnable WSL’s **mirrored networking** so DDS/multicast and inbound traffic reach WSL correctly:\n\n```ini\n# %UserProfile%\\.wslconfig\n[wsl2]\nnetworkingMode=mirrored\n```\n\nThen restart WSL:\n\n```bash\nwsl --shutdown\n```\n\n(These rules target Hyper-V in mirrored mode and play nicely with ROS.)\n\n---\n\n## Features\n\n* Create / delete / search Hyper-V firewall rules\n* TCP / UDP / ICMPv4, **inbound / outbound / both**\n* Multiple IPs, custom local/remote ports\n* **Idempotent** (won’t duplicate)\n* `--dry-run` to preview\n* Optional JSON snapshot with `--db`\n* Safety guard for mass deletes (override with `--all`)\n\n---\n\n## Requirements\n\n* Windows 10/11 with Hyper-V (admin rights for firewall changes)\n* WSL (Ubuntu etc.), Python 3\n* `powershell.exe` reachable from WSL\n\n---\n\n## Quick start\n\n```bash\n# Help\npython3 wsl_ros2_hv_firewall.py -h\n\n# ROS/ROS2: allow all protocols IN+OUT for a robot IP (scoped to a single host)\npython3 wsl_ros2_hv_firewall.py create --ip 192.168.0.213\n\n# ROS1 (tighter): allow TCP IN for ports 11311,8080 only\npython3 wsl_ros2_hv_firewall.py create \\\n  --ip 192.168.0.213 \\\n  --protocol tcp \\\n  --direction in \\\n  --local-ports 11311,8080 \\\n  --remote-ports 11311,8080\n\n# Search rules (and also write a JSON snapshot)\npython3 wsl_ros2_hv_firewall.py --db search\n\n# Delete by exact/wildcard name (dry run first)\npython3 wsl_ros2_hv_firewall.py delete --name 'WSL-ROS2-*' --dry-run\n\n# More examples\npython3 wsl_ros2_hv_firewall.py examples\n```\n\n---\n\n### Notes\n\n* **Persistence is off by default.** Add `--db` (before or after the subcommand) to write `wsl_ros2_firewall_rules.json`.\n* Mass deletes are limited; pass `--all` to confirm large removals.\n\n---\n\nIf this helped your ROS setup in WSL, a ⭐️ would be awesome.\nSpotted a bug or have an idea? **Issues and PRs welcome!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismaolen%2Fwsl2-hyperv-firewall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fismaolen%2Fwsl2-hyperv-firewall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismaolen%2Fwsl2-hyperv-firewall/lists"}