-
配置kali usb网卡
-
kali不支持内置网卡,仅仅支持usb网卡
-
添加静态IP配置
# vim /etc/network/interfaces ''' allow-hotplug eth0 auto eth0 iface eth0 inet static address 192.168.24.129 【自定义本机虚拟网卡的同网段ip】 netmask 255.255.255.0 gateway 192.168.24.2 '''
-
修改dns
# vim /etc/resolv.conf ''' nameserver 192.168.24.2 【填写自定义dns ip】 '''
-
启动网络服务
# service networking restart
-
-
可能报错
-
报错描述:
kali systemd[1]: Starting Raise network interfaces... kali ifup[3457]: RTNETLINK answers: File exists kali ifup[3457]: ifup: failed to bring up eth0 kali systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE kali systemd[1]: networking.service: Failed with result 'exit-code'. kali systemd[1]: Failed to start Raise network interfaces.
-
解决方案:
# ip addr flush dev eth0 # service networking restart # service networking status 【查看状态】
-
打开kali ssh服务
-
操作步骤
-
-
修改配置文件:
# vim /etc/ssh/sshd_config 找到下面配置,取消注释,并保持与下面配置一致 ''' PermitRootLogin yes PasswordAuthentication yes '''
-
重启服务
-
# service ssh restart # service ssh status 【查看状态】
-
-
-
修改网卡配置:
# vim /etc/sysconfig/network-scripts/ifcfg-ens33 【根据虚机实际网卡名】 ''' BOOTPROTO=none ONBOOT=yes IPADDR=192.168.24.239 NETMASK=255.255.255.0 GATEWAY=192.168.24.2 '''
修改dns:
# vim /etc/resolv.conf
'''
nameserver 223.5.5.5
''' -
重启网络
# systemctl restart network # systemctl status network
-
-
vmnet1
-
这是一个Host-Only网络模式
-
用于建立一个与世隔绝的网络环境所用到
-
-
vmnet8
-
这是一个NAT方式,最简单的组网方式了
-
是一个NAT方式,最简单的组网方式了
-
-
查看vmware中虚机的网关指向
-
cat /Library/Preferences/VMware Fusion/vmnet8/nat.conf
-
根据vmnet网卡号,寻找【# NAT gateway address】这一行下面的ip即是虚机所要配置的网卡
-
-