ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

【KALI】设置静态IP地址

2026/9/22 16:24:07 拓冰建站 浏览量
【KALI】设置静态IP地址
ip: 192.168.1.10/24
网关:192.168.1.1
DNS:192.168.1.254

/etc/network/interfaces原始文件内容为:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

修改后为:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).source /etc/network/interfaces.d/*# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
#allow-hotplug eth0
auto eth0
iface eth0 inet staticaddress 192.168.1.10netmask 255.255.255.0gateway 192.168.1.1

然后就是DNS:
/etc/resolv.conf增加:

nameserver 202.96.134.133

基本设置完成,重启网络服务以应用更改:

systemctl restart networking