检查 ipv4 和用于 Linux 和 FreeBSD 的 C 语言的 ipv6 转发
我试图弄清楚是否允许转发(对于我的应用程序来说是必需的)。我需要检查 Linux 和 FreeBSD。不幸的是G叔叔没有返回任何结果。
I am trying to figure out whether forwarding is allowed (necessary for my app). I need to check for both Linux and FreeBSD. Unfortunately uncle G didn't return any results.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
sysctl
在 BSD 上读取net.inet.ip.forwarding
和net.ipv4.ip_forward
(或net. Linux 上的 ipv4.conf.all.forwarding
,它们是同义词)和net.ipv6.conf.all.forwarding
。You can use
sysctl
to readnet.inet.ip.forwarding
on BSD, andnet.ipv4.ip_forward
(ornet.ipv4.conf.all.forwarding
, they're synonyms) andnet.ipv6.conf.all.forwarding
on Linux.