debian

Debian Stream 8如何进行网络配置

小樊
32
2025-08-20 12:08:38
栏目: 智能运维

Debian Stream 8 通常使用 /etc/network/interfaces 文件配置网络(部分场景可能使用 Netplan,但非主流)。以下是具体步骤:

1. 查看网卡名称

先确认网卡名称(如 eth0enp3s0 等):

ip addr show  

2. 配置静态 IP(推荐)

编辑网络配置文件:

sudo nano /etc/network/interfaces  

添加以下内容(以 eth0 为例):

auto eth0  
iface eth0 inet static  
    address 192.168.1.100/24  # IP地址+子网掩码  
    gateway 192.168.1.1       # 网关  
    dns-nameservers 8.8.8.8 8.8.4.4  # DNS服务器  

保存后重启网络:

sudo systemctl restart networking  

3. 配置动态 IP(DHCP)

若需自动获取 IP,修改配置为:

auto eth0  
iface eth0 inet dhcp  

保存后重启网络:

sudo systemctl restart networking  

4. 验证配置

注意事项

以上配置适用于 Debian 10/11 及 Stream 8 等版本。

0
看了该问题的人还看了