如何通过 DHCP 可靠地获取 IP 地址?

发布于 2024-07-04 12:01:09 字数 1570 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

ζ澈沫 2024-07-11 12:01:09

添加到rc.local检查是否已获得IP。 如果没有设置“at”工作,请在不久的将来再次尝试。 继续调度“at”作业,直到获得 IP。

Add to rc.local a check to see if an IP has been obtained. If no setup an 'at' job in the near future to attempt again. Continue scheduling 'at' jobs until an IP is obtained.

久而酒知 2024-07-11 12:01:09

您有多种选择:

  1. 当您没有 IP 地址时,重新启动 dhcpcd 以获得更多重试次数。
  2. 拥有备用静态 IP 地址。 这在我制作的嵌入式设备中非常成功。
  3. 使用自动IP作为备份。 Windows 就是这样做的。

You have several options:

  1. While you don't have an IP address, restart dhcpcd to get more retries.
  2. Have a backup static IP address. This was quite successful in the embedded devices I've made.
  3. Use auto-IP as a backup. Windows does this.
池木 2024-07-11 12:01:09

来自 ISC 的参考 dhclient 应在默认配置下永远运行,如果在启动时未获得租约,则应稍后获得租约。

我在 FreeBSD 上使用开箱即用的 dhcp 客户端,它源自 OpenBSD 并基于 ISC 的 dhclient,这是开箱即用的行为。

请参阅 http://www.isc.org/index.pl?/sw/ DHCP/

The reference dhclient from the ISC should run forever in the default configuration, and it should acquire a lease later if it doesn't get one at startup.

I am using the out of the box dhcp client on FreeBSD, which is derived from OpenBSD's and based on the ISC's dhclient, and this is the out of the box behavior.

See http://www.isc.org/index.pl?/sw/dhcp/

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