HDMatt
HDMatt
发布于 2024-04-02 / 89 阅读 / 0 评论 / 0 点赞

Debian设置固定IP和网关

1、安装sudo:

apt install sudo

 

2、编辑文件:

sudo nano /etc/network/interfaces

 

3、按“i”键启动编辑模式;

 

# The primary network interface

allow-hotplug ens192

# iface ens192 inet dhcp

auto ens192

iface ens192 inet static

    address 10.5.5.5

    netmask 255.255.255.0

    gateway 10.5.5.6

    dns-nameservers 61.139.65.1

 

4、按ctrrl+x,选Y,回车。

 

5、重启生效

 


评论