在我的电脑上,当前存在3个不同的网络接口,假设interface1,interface2,interface3都具有不同的IP。我想以某种方式运行gpsd守护程序,使其应绑定到我想要的某些特定接口(interface1)。
当前iam正在如下运行gpsd
gpsd -b -n #I think here gpsd binds to localhost.
我的目标是运行类似的gpsd
gpsd -b -n interface1_ip #here gpsd should bind to only interface1.
我该怎么做?
一种快速而肮脏的方法是使用-G选项启动gpsd,以启用对all接口的监视(默认情况下,gpsd将仅侦听localhost的安全性和隐私性),然后通过以下方式禁用不需要的接口的访问:具有正确的防火墙规则(禁止访问两个不需要的接口)。Gpsd会监听2947端口,您可以使用-S选项更改它以满足您的需求。