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

Full các trường data có thể lấy từ AD on-prem

Mail Presence PermissionGrants Department ImAddresses Responsibilities AppRoleAssignments ...