乐享奈飞 乐享奈飞

乐享奈飞-乐享无限,共享自由。

目录
debian静态ip
/  

debian静态ip

1.在虚拟机的编辑-虚拟网络编辑器里面,把dhcp服务关掉。

2. 网卡是ens33

命令:vim /etc/network/interfaces
静态ip
nano /etc/network/interfaces  /etc/network/interfacesbak   #备份原有配置文件
nano /etc/network/interfaces   #编辑网网卡配置文件
auto lo
auto ens33  #开机自动连接网络
iface lo inet loopback
allow-hotplug ens33
iface ens33inet static   #static表示使用固定ip,dhcp表述使用动态ip
address 192.168.2.22  #设置ip地址
netmask 255.255.255.0  #设置子网掩码
gateway 192.168.2.2    #设置网关
#network 192.168.2.0
#broadcast 192.168.2.255
ctrl+o   #保存配置
ctrl+x   #退出

设置IP地址、网关

设置dns

ctrl+o #保存配置

ctrl+x #退出

重启网络


标题:debian静态ip
作者:Dragon
地址:https://so.98hg.top/articles/2022/11/11/1668154522525.html