一、查看主机ip
1.win+r输入cmd
2.进入终端输入ipconfig
3.查看ip
二、虚拟机网络设置
1.进入vm的虚拟网络编辑器

2.桥接网卡自己选,1是有线网卡2是无线网卡,选择记得点应用

3.虚拟机的网络适配器也要选择桥接模式

三、kali网络配置
1.打开kali终端编辑文件/etc/network/interfaces
sudo vim /etc/network/interfaces
若是设置静态ip就将内容改成
auto eth0
iface eth0 inet static
address ip
netmask 子网掩码
gateway 网关
若是设置动态ip随DHCP自由分配那就改成
auto eth0
iface eth0 inet dhcp
2.编辑/etc/resolv.conf文件
sudo vim /etc/resolv.conf
添加DNS服务器,随便选一个
114.114.114.114是电信的
8.8.8.8是goolge的
nameserver 114.114.114.114
nameserver 8.8.8.8
3.重启网络服务
sudo systemctl restart networking