跳转到内容

在 OpenBSD 上建立互联网连接

了解如何在 OpenBSD 上配置互联网连接。

1. 背景

2. 手动网络配置步骤

3. 常见问题解答 (FAQ)

1. 背景

OpenBSD 默认使用 dhcpleased。但是,它与我们的基础设施不兼容。作为替代方案,您可以使用 isc-dhcp-client

2. 手动网络配置步骤

无法通过 OpenBSD 安装程序进行自动连接。请按照以下步骤手动设置网络连接:

  1. DVD 启动并安装 OpenBSD,且不配置网络接口(选择“none”)。
  2. 使用 VNC 控制台登录并手动配置网络:

ifconfig vio0 <IPAddress> netmask <IPNetmask>

echo "nameserver 46.38.252.230\nnameserver 46.38.225.230" >> /etc/resolv.conf

route add default <GatewayIP>

  1. 若要使网络配置永久生效,请创建文件 /etc/hostname.vio0,内容如下:

inet <IPAddress> <IPNetmask>

!route add default <GatewayIP>

  1. 然后,运行 sh /etc/netstart 配置网络接口。

3. 常见问题解答 (FAQ)

对于预配置镜像,我们使用通过 cloud-init 配置的云镜像。但是,OpenBSD 官方本身并不提供官方云镜像(截至 2025 年 8 月)。

最近更新:2026 年 4 月 24 日