简体   繁体   English

如何获取防火墙 IP 地址的详细信息

[英]How get details on Firewall IP address

Is there any way to check firewall IP address, port number, subnet mask using PowerShell command?有没有办法使用PowerShell命令检查防火墙IP地址、端口号、子网掩码?

I tried search, however, got only Primary IP instead我试过搜索,但是,只得到了主 IP

You can only get back what you ask for.你只能取回你所要求的。 So, you need to know how to ask the target for it.因此,您需要知道如何向目标询问。

A firewall device is nothing but a regular computer, even if it is purpose built.防火墙设备只不过是一台普通的计算机,即使它是专门构建的。 So, if you can reach it, just use the PowerShell network, network adapters, connection and firewall cmdlets to get information about it.因此,如果您可以访问它,只需使用 PowerShell 网络、网络适配器、连接和防火墙 cmdlet 即可获取有关它的信息。 That is if the FW you are trying to reach supports it.也就是说,如果您尝试联系的 FW 支持它。

There are several examples for you to use in the PowerShell built-in help files. PowerShell 内置帮助文件中有几个示例供您使用。 So, you should find all the examples you need here:所以,你应该在这里找到你需要的所有例子:

Get-Help -Name Get-NetIPConfiguration -Examples
Get-Help -Name Get-NetAdapter -Examples
Get-Help -Name Get-NetIPAddress -Examples
Get-Help -Name Get-NetIPInterface -Examples

That first one will give you virtually all you are asking for, except for ports.第一个将为您提供几乎所有您需要的东西,除了端口。 FW's can have a lot of ports open, so, you need to just do a port scan on it to see which ones are open.固件可以打开很多端口,因此,您只需对其进行端口扫描即可查看哪些端口是打开的。 That is what the cmdlet below is for.这就是下面的 cmdlet 的用途。

Get-Help -Name Test-NetConnection -Examples

Just pipe in a list of ports using a for loop.只需使用 for 循环输入端口列表即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM