linux使用笔记

设置固定IP

debian

默认网卡配置文件

/etc/network/interfaces

找到文件内对应网卡,将 dhcp修改为static,并增加IP地址

iface <网卡名> inet static
address 192.168.1.2    # IP地址
netmask 255.255.255.0  # 子网掩码
gateway 192.168.1.1    # 网关

设置DNS文件/etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4
posted @ 2022-11-01 15:28  chilono  阅读(21)  评论(0编辑  收藏  举报