Add an explanation for static IP

This commit is contained in:
BuGu
2025-06-26 11:29:27 +08:00
parent 44f3e01774
commit 4bd0d354ac
2 changed files with 28 additions and 4 deletions

View File

@@ -13,7 +13,19 @@ By default, NanoKVM obtains its IP address via DHCP, which means the IP address
If you want to always access NanoKVM using the same IP address, you can set a static IP.
## Setting a Static IP
Here are two methods to set a static IP:
## Setting Static IP via Router
Most routers have a feature for setting static IPs for devices. If you can easily access the router's management page, it's recommended to use this method.
In the router management interface, you can find the device with the name `kvm` and set the IP directly.
## Setting Static IP in NanoKVM
If accessing the router's backend is not convenient, you can also set the static IP directly in NanoKVM. Heres how:
### Setting Static IP
Create a file `/boot/eth.nodhcp` in NanoKVM and edit it as follows:
@@ -32,6 +44,6 @@ After editing and saving the file, run the command `/etc/init.d/S30eth restart`
This ensures that NanoKVM always has a usable IP address, allowing network access to operate NanoKVM. If NanoKVM does not receive a valid IP address, you will need to manually modify the file on the TF card or reflash the image to use it normally.
## Canceling the Static IP
### Canceling the Static IP
Delete the `/boot/eth.nodhcp` file to cancel the static IP setting. NanoKVM will then obtain its IP address via DHCP again.

View File

@@ -13,7 +13,19 @@ NanoKVM 默认通过 DHCP 获取 IP这意味着 NanoKVM 的 IP 可能会发
如果你希望始终使用同一个 IP 来访问 NanoKVM可以给 NanoKVM 设置一个静态 IP。
## 设置静态 IP
下面介绍两种方法设置静态IP
## 通过路由器设置静态IP
路由器后台往往有设置设备静态IP的功能如果您可以方便的进入路由器的管理页面建议使用此方式。
在路由器管理后台可以找到带有`kvm`名字的设备并直接设置IP。
## 在NanoKVM中设置静态 IP
如果不方便进入路由器后台也可以直接在NanoKVM中设置方法如下
### 设置静态IP
在 NanoKVM 中创建文件 `/boot/eth.nodhcp` ,然后按照以下规则进行编辑:
@@ -34,6 +46,6 @@ NanoKVM 默认通过 DHCP 获取 IP这意味着 NanoKVM 的 IP 可能会发
这是为了保证 NanoKVM 总有一个可用的 IP 地址,以便能通过网络来操作 NanoKVM。
如果 NanoKVM 没有分配到可用的 IP 地址,则需要手动修改 TF 卡中的文件,或者重新烧录镜像才能正常使用。
## 取消静态 IP
### 取消静态IP设置
删除 `/boot/eth.nodhcp` 文件,即可取消静态 IP。NanoKVM 会重新通过 DHCP 来获取 IP。