windows防火墙 程序_如何允许应用程序通过Windows防火墙进行通信

windows防火墙 程序

windows防火墙 程序

lead

The Windows Firewall acts like a fence between your computer and the rest of the Internet world, keeping unwanted network traffic from coming in, and keeping apps on your computer from communicating with the outside world. But every fence needs a gate, and that’s where exceptions come in.

Windows防火墙的作用就像您的计算机与Internet世界其他部分之间的篱笆一样,可防止不必要的网络流量进入,并防止计算机上的应用程序与外界通信。 但是每个栅栏都需要一扇门,这就是例外的地方。

When you allow an app to communicate through the firewall, it’s called adding an “exception”. For the most part, this all happens automatically. Windows creates exceptions for its own system services and apps, and when you install a new app that wants to communicate with the outside world, Windows will ask you if it’s allowed to do so.

当您允许某个应用通过防火墙进行通信时,这称为添加“例外”。 在大多数情况下,这一切都是自动发生的。 Windows为自己的系统服务和应用程序创建例外,并且当您安装要与外界通信的新应用程序时,Windows会询问您是否允许这样做。

Sometimes, though, you might want to create an exception manually to allow an app to communicate with the Internet. Perhaps it’s a app you originally said no to when Windows asked, but now you’ve changed your mind. Or maybe it’s an app that just didn’t get configured automatically for some reason. In those cases, you’ll need to head into Windows’ firewall settings.

但是,有时您可能希望手动创建一个例外,以允许应用程序与Internet通信。 也许这是您最初在Windows询问时拒绝的应用程序,但现在您改变了主意。 也许这是一个由于某种原因未自动配置的应用程序。 在这种情况下,您需要进入Windows的防火墙设置。

如何手动添加异常 (How to Add an Exception Manually)

Start the Windows Firewall settings by clicking Start and searching for Firewall. Click the Windows Firewall app and not Windows Firewall with Advanced Security. We’ll talk about that one a bit later.

通过单击开始并搜索防火墙来启动Windows防火墙设置。 单击Windows防火墙应用程序,而不单击具有高级安全性的Windows防火墙。 我们稍后再讨论。

Firewall Start

The Windows Firewall screen shows you how the firewall is configured for both private networks (such as your home or work) and public networks (the ones you connect to on your laptop out in the world). On the list of settings to the left, click “Allow an app or feature through Windows Firewall”.

Windows防火墙屏幕向您显示如何为专用网络(例如您的家庭或办公室)和公用网络(您在笔记本电脑上连接的防火墙)配置防火墙。 在左侧的设置列表中,单击“允许应用程序或功能通过Windows防火墙”。

Firewall main

The next view shows you a list of all the apps that are already allowed to communicate, and over what kinds of networks (private or public). If it’s the first time you’ve opened Windows Firewall, click the Change Settings button to give yourself permissions to make changes or add new apps. You’ll only need to do this once. To add a new app to the list, click “Allow another app”.

下一个视图显示了已允许通过哪种类型的网络(专用或公用)进行通信的所有应用程序的列表。 如果这是您第一次打开Windows防火墙,请单击“更改设置”按钮,以授予自己进行更改或添加新应用的权限。 您只需要这样做一次。 要将新应用添加到列表中,请单击“允许另一个应用”。

view apps

In the Add an app window, browse for the app you want to allow network access to. Click the Network types button to specify whether you want to allow the app access on public or private networks (or both). Click Add when you’re done and that’s it. You’ve allowed the app through your firewall–you’ll see it show up on the list of allowed apps, and it should be allowed to use internet or network-related features.

在“添加应用程序”窗口中,浏览要允许网络访问的应用程序。 单击网络类型按钮以指定是否要允许应用程序访问公用或专用网络(或两者)。 完成后,单击“添加”即可。 您已通过防火墙允许该应用程序-您将看到它显示在允许的应用程序列表中,并且应该允许它使用与Internet或网络相关的功能。

pick app

如何配置高级防火墙规则 (How to Configure Advanced Firewall Rules)

Windows actually provides you with two different interfaces for working with the firewall. The basic Settings interface we just looked at is by far the simplest way just to allow an app to communicate. Another tool, Windows Firewall with Advanced Security, has a lot more options. You can use it do things like:

Windows实际上为您提供了两个不同的界面来使用防火墙。 到目前为止,我们刚刚看到的基本“设置”界面是允许应用进行通信的最简单方法。 另一个工具,具有高级安全性的Windows防火墙,具有更多选择。 您可以使用它执行以下操作:

  • Create rules governing inbound and outbound traffic for not just apps, but also network traffic coming in over a specific port. A good use of this might be directing incoming traffic that uses a particular port number to a selected app.

    创建规则,不仅管理应用程序的入站和出站流量,还管理通过特定端口传入的网络流量。 最好的用法是将使用特定端口号的传入流量定向到选定的应用程序。
  • Direct network traffic to particular computers on your local network based on the app or port numbers.

    根据应用程序或端口号将网络流量定向到本地网络上的特定计算机。
  • Create connection security rules that force other computers attempting to communicate with yours to use different types of authentication protocols to establish their identity.

    创建连接安全规则,以强制尝试与您的计算机进行通信的其他计算机使用不同类型的身份验证协议来建立其身份。
  • Monitor the use of rules and other security associations.

    监视规则和其他安全关联的使用。

It’s unlikely that you’ll ever need any of the features offered by Windows Firewall with Advanced Security except in special circumstances. Perhaps you use one of your computers to share your Internet connection and serve as the main firewall for your network. Still, it’s helpful to know the options are there if you need them, even it’s only for knowing why two different Windows Firewall apps appear when you search for them.

除特殊情况外,您不太可能需要具有高级安全性的Windows防火墙提供的任何功能。 也许您使用一台计算机共享Internet连接,并充当网络的主要防火墙。 尽管如此,了解您是否需要这些选项还是有帮助的,即使只是知道为什么在搜索时会出现两个不同的Windows防火墙应用程序也很有帮助。

Also keep in mind that most homes and businesses have a dedicated hardware firewall built into their router, making it even less likely you’ll need these types of features on your Windows computer. If you do need to set up rules for directing traffic, you’ll probably do it on the router itself.

还要记住,大多数家庭和企业在路由器中都内置了专用的硬件防火墙,这使您在Windows计算机上使用这些功能的可能性降低了。 如果确实需要设置引导流量的规则,则可能会在路由器本身上进行。

翻译自: https://www.howtogeek.com/howto/uncategorized/how-to-create-exceptions-in-windows-vista-firewall/

windows防火墙 程序

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在C++中,可以使用Windows API函数来设置允许应用程序通过防火墙进行通信。具体步骤如下: 1. 首先,需要包含Windows.h头文件。 2. 创建一个类型为INetFwProfile的防火墙配置对象。可以使用以下代码创建一个防火墙配置对象: ``` INetFwProfile* pfwProfile = NULL; HRESULT hr; hr = CoInitializeEx(0, COINIT_APARTMENTTHREADED); if (FAILED(hr)) { return -1; } hr = CoCreateInstance(__uuidof(NetFwProfile), NULL, CLSCTX_INPROC_SERVER, __uuidof(INetFwProfile), (void**)&pfwProfile); if (FAILED(hr)) { CoUninitialize(); return -1; } ``` 3. 接下来,使用防火墙配置对象的方法来创建一个允许应用程序通过防火墙进行通信的规则。可以使用以下代码创建一个规则: ``` INetFwRule* pfwRule = NULL; hr = CoCreateInstance(__uuidof(NetFwRule), NULL, CLSCTX_INPROC_SERVER, __uuidof(INetFwRule), (void**)&pfwRule); if (FAILED(hr)) { pfwProfile->Release(); CoUninitialize(); return -1; } pfwRule->put_Name(_bstr_t("MyApp Rule")); pfwRule->put_Description(_bstr_t("Allow MyApp to communicate through the firewall")); pfwRule->put_ApplicationName(_bstr_t("C:\\Path\\To\\MyApp.exe")); pfwRule->put_Action(NET_FW_ACTION_ALLOW); pfwRule->put_Enabled(VARIANT_TRUE); pfwProfile->get_Rules(&pfwRules); pfwRules->Add(pfwRule); pfwRules->Release(); pfwRule->Release(); ``` 这段代码将创建一个名为“MyApp Rule”的规则,允许路径为“C:\Path\To\MyApp.exe”的应用程序通过防火墙进行通信。 4. 最后,释放防火墙配置对象和COM库: ``` pfwProfile->Release(); CoUninitialize(); ``` 这就是如何使用C++代码设置允许应用程序通过防火墙进行通信的方法。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值