通过防火墙允许 WCF udpDiscoveryEndpoint [英] Allowing WCF udpDiscoveryEndpoint though firewall

查看:28
本文介绍了通过防火墙允许 WCF udpDiscoveryEndpoint的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 basicHttpBinding 端点的 WCF Windows 服务,监听 TCP/12345.我加了一个udpDiscoveryEndpoint,本地发现服务没问题.

I have a WCF Windows Service using a basicHttpBinding endpoint, listening on TCP/12345. I have added a udpDiscoveryEndpoint, and can discover the service locally no problems.

<services>
  <service name="BigBadCompany.Delivery.DeliveryService" behaviorConfiguration="DeliveryServiceBehavior">
    <host>
      <baseAddresses>
        <add baseAddress="http://*:12345/Delivery/service"/>
      </baseAddresses>
    </host>
    <endpoint address="" binding="basicHttpBinding" contract="BigBadCompany.Delivery.IDelivery" bindingConfiguration="DeliveryServiceBinding"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <endpoint kind="udpDiscoveryEndpoint" />
  </service>
</services>

为了让它在本地子网上通过网络发现,我需要添加一个防火墙规则来允许流量.如果我允许所有 UDP 流量,我只能让它工作.如果我将规则限制为仅我的服务,发现就会中断.我还尝试将其限制在一个端口(我猜想这可能与 TCP 端口相同,但我找不到任何关于 UDP 广播使用的端口的信息)它也会停止.

To get it to discover across the network on the local subnet, I need to add a firewall rule to permit the traffic. I can only get this working if I permit ALL UDP traffic. If I restrict the rule to only my service, discovery breaks. I also tried restricting it to one port (which for no good reason I guessed might be the same as the TCP port, I can't find any info on what port the UDP broadcasts use) it also stops.

在不打开所有入站 UDP 端口的情况下只允许 udpDiscoveryEndpoint 流量的适当防火墙规则是什么?

What would be an appropriate firewall rule to permit just the udpDiscoveryEndpoint traffic without opening all UDP ports inbound?

推荐答案

您应该只为端口 3702 添加例外.查看更多信息:

You should just add exception for port 3702. See more here:

https://msdn.microsoft.com/en-us/library/dd352335.aspx

--编辑--

网址已过期;这是备份:

The URL has expired; here's a backup:

https://web.archive.org/web/20161111140652/https://msdn.microsoft.com/en-us/library/dd352335.aspx

这篇关于通过防火墙允许 WCF udpDiscoveryEndpoint的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆