Files
Knowledge/1 使用/Linux/Ubuntu 安装_23013RK75C_Jan-29-0936-2026_1.md
T

32 lines
858 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
### 安装需要网络问题
### 如何通过 ip 命令配置网络(临时)
查看
ip addr show
ip a
### 配置静态IP地址
要为网络接口配置静态 IP 地址,您可以使用 `ip addr add` 命令。例如,为 `eth0` 接口配置 IP 地址 `192.168.1.100` 和子网掩码 `255.255.255.0`:
`sudo ip addr add 192.168.1.100/24 dev eth0`
### 设置默认网关
要设置默认网关,可以使用 `ip route add` 命令。例如,设置网关为 `192.168.1.1`:
`sudo ip route add default via 192.168.1.1`
### 设置DNS服务器
在 Ubuntu 中,DNS 服务器的设置通常在 `/etc/resolv.conf` 文件中进行。您可以使用文本编辑器编辑该文件来添加 DNS 服务器:
`sudo nano /etc/resolv.conf`
然后添加您的 DNS 服务器,例如:
`nameserver 8.8.8.8 nameserver 8.8.4.4`
保存并退出编辑器。