Closed Zerorigin closed 1 week ago
@Zerorigin Thanks for the detailed description which is really helpful to understand your use case and locate the problem.
Currently the interface
argument is just for outbound connections/traffics. Inbound ones has not been implemented but I will add this missing feature soon when I have time.
@Zerorigin Hey, maybe you could use specific ip address instead of [::]
@Zerorigin Hey, maybe you could use specific ip address instead of
[::]
不太可行,因为 IPv6 地址不是固定的。
Okay. Technically I think it's feasible to bind a LISTEN socket to a given interface with setsockopt(SO_BINDTODEVICE)
, which would be helpful to your use case.
Hey @Zerorigin ,
Now you could specify the inbound interface by adding -e <iface>
to cmd arguments; or with a config file (docs here):
[[endpoint]]
#...
listen_interface = "<iface>"
Hey @Zerorigin ,
Now you could specify the inbound interface by adding
-e <iface>
to cmd arguments; or with a config file (docs here):[[endpoint]] #... listen_interface = "<iface>"
大佬,有点强,setsockopt(SO_BINDTODEVICE)
相关资料其实之前我也搜过,但是感觉自己估计搞不定,就没尝试编写代码测试。
我这两天抽空测试下新的配置项,到时候再来找您反馈。
Now you could specify the inbound interface by adding
-e <iface>
to cmd arguments; or with a config file (docs here):[[endpoint]] #... listen_interface = "<iface>"
在基于 Linux 内核的路由网关平台上测试了下, 能在子接口的 IPv4 & IPv6 入站正确监听相关端口并转发了, 并且网关宽带重新拨号后,也能在子接口新分配的 IP 上监听, 感觉没啥问题了,这个 issue 应该可以考虑关闭了。
打算将 realm 部署在网关路由器上,网关上的虚拟接口 lan(br-lan)绑定了多个网口设备 ethX,并通过 vlan 划分了多个虚拟子接口,我想在其中一个虚拟子接口监听特定端口进行转发,但 realm 似乎还是会监听所有的 IPv4、IPv6 地址,而不是仅监听虚拟子接口 interface 上的 IPv4、IPv6 地址。
我的配置如下: