ubuntu22.04 命令行修改静态ip

传统interfaces文件配置(适用于旧版)即便我们已经在桌面上配置了固定ip 这里也可以修改
‌编辑配置文件‌
修改/etc/network/interfaces(需安装net-tools):

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source /etc/network/interfaces.d/*
auto eth1
iface eth1 inet static
address 192.168.5.105
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 222.222.202.202

‌重启网络服务‌

你可能感兴趣的:(tcp/ip,服务器,linux)