Disable firewall trên một card mạng cụ thể

Khi máy tính có từ 2 card mạng trở lên, muốn tắt tường lửa chỉ trên 1 card, còn lại card kia vẫn sử dụng tường lửa bình thường.

Chạy Powershell quyền admin:

Set-NetFirewallProfile -Profile <profile> -DisabledInterfaceAliases "<adapter name>"

Profile là một trong các loại: "Domain", "Private" và "Public" 

Set-NetFirewallProfile -Profile Public -DisabledInterfaceAliases "VirtualBox Host-Only Network"

Để lấy adapter name thì chạy lệnh:

Get-NetAdapter -Name * | Format-List

Khi muốn hủy chế độ này, Firewall trở lại hoạt động trên tất cả các card thì chạy lệnh dưới đây, trong đó @() là một mảng rỗng:
Set-NetFirewallProfile -Profile Public -DisabledInterfaceAliases @() 

 

No comments:

Post a Comment

MS 365 chạm giới hạn số lượng xóa user cùng lúc

Để tránh xóa nhầm, trên hệ thống AAD Connect sẽ có giới hạn số lượng user xóa trong cùng 1 lượt:  https://learn.microsoft.com/en-us/entra/id...