# Allow ping from local subnet and RustDesk Ports

#### Quick PowerShell Method

Run `PowerShell` as <span style="color: rgb(224, 62, 45);">**Administrator**</span> on the target PC.


##### Allow ping from local subnet :

```powershell
New-NetFirewallRule -DisplayName "Allow ICMP Ping LAN" -Direction Inbound -Protocol ICMPv4 -IcmpType 8 -RemoteAddress LocalSubnet -Action Allow
```

- Replace <span style="color: rgb(224, 62, 45);">**LocalSubnet**</span> with your range if needed (e.g., <span style="color: rgb(224, 62, 45);">**192.168.1.0/24** </span>).
- Test: ping target PC from another LAN PC.

##### Disable if needed :

```powershell
Disable-NetFirewallRule -DisplayName "Allow ICMP Ping LAN"
```

#### GUI Method (Advanced Security)

1. Search "Windows Defender Firewall with Advanced Security" &gt; Inbound Rules &gt; New Rule.
2. Custom &gt; All programs &gt; Next.
3. Protocol: ICMPv4 &gt; Customize &gt; Specific ICMP types: Echo Request &gt; OK &gt; Next.
4. Local: Any IP &gt; Remote: These IP addresses &gt; Add your LAN subnet (e.g., 192.168.1.0/24) &gt; Next.
5. Allow connection &gt; All profiles &gt; Next.
6. Name: "Allow Ping LAN" &gt; Finish.

#### RustDesk ports Allow from local subnet :

For full LAN direct connect (green status), also allow these inbound on target :

- TCP/UDP 21115-21117, 21118-21119 (RustDesk ports).

Use similar PowerShell :

##### Allow TCP Ports 

```powershell
New-NetFirewallRule -DisplayName "RustDesk TCP LAN" -Direction Inbound -LocalPort 21115-21119 -Protocol TCP -RemoteAddress LocalSubnet -Action Allow
```

##### Allow UDP Ports

```powershell
New-NetFirewallRule -DisplayName "RustDesk UDP LAN" -Direction Inbound -LocalPort 21115-21119 -Protocol UDP -RemoteAddress LocalSubnet -Action Allow
```