检查 ipv4 和用于 Linux 和 FreeBSD 的 C 语言的 ipv6 转发

发布于 2024-12-18 19:12:40 字数 74 浏览 6 评论 0原文

我试图弄清楚是否允许转发(对于我的应用程序来说是必需的)。我需要检查 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

饮湿 2024-12-25 19:12:40

您可以使用 sysctl 在 BSD 上读取 net.inet.ip.forwardingnet.ipv4.ip_forward (或 net. Linux 上的 ipv4.conf.all.forwarding,它们是同义词)和 net.ipv6.conf.all.forwarding

You can use sysctl to read net.inet.ip.forwarding on BSD, and net.ipv4.ip_forward (or net.ipv4.conf.all.forwarding, they're synonyms) and net.ipv6.conf.all.forwarding on Linux.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文