kali的網絡IP設置


進入配置文件,配置IP

leafpad /etc/network/interfaces.conf

寫入如下格式的內容:

/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp
# This is an autoconfigured IPv6 interface
iface eth0 inet6 auto

修改為:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
auto eth0                 //增加了該選項,因為使用networking restart時系統啟動                            auto的網卡,如不加上則啟動無反應
iface eth0 inet static    //配置了static 為靜態ip
address 192.168.1.4       //設置ip地址
netmask 255.255.255.0     //設置掩碼
gateway 192.168.1.1       //設置網關
# This is an autoconfigured IPv6 interface
iface eth0 inet6 auto

配置DNS(注:先刪除一個之后再新建一個resolv.conf,可防止重啟后resolv.conf內容被清空)

leafpad /etc/resolv.conf

/etc/resolv.conf
nameserver 202.106.0.20
nameserver 202.106.46.151

修改為:
nameserver 202.106.0.20
nameserver 202.106.46.151
nameserver 8.8.8.8

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM