实验环境:kali虚拟机,4G运行
实验目的:使用dhcp分配kali的IP地址
实验步骤:
1,配置虚拟机网络适配器
2,配置网卡
┌──(root💀kali)-[~]
└─# vim /etc/network/interfaces 网卡配置路径
auto lo
iface lo inet loopback
3,进行验证
┌──(root💀kali)-[~]
└─# systemctl restart networking 重启网卡
┌──(root💀kali)-[~]
└─# ifconfig eth0 查看网卡信息
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.22.137 netmask 255.255.255.0 broadcast 192.168.22.255
inet6 fe80::20c:29ff:fed2:2719 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:d2:27:19 txqueuelen 1000 (Ethernet)
RX packets 8129 bytes 5984487 (5.7 MiB)
RX errors 4 dropped 7 overruns 0 frame 0
TX packets 8150 bytes 846147 (826.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 18 base 0x2000
┌──(root💀kali)-[~]
└─# ping www.baidu.com ping百度看网络状态是否正常
PING www.a.shifen.com (39.156.66.18) 56(84) bytes of data.
64 bytes from 39.156.66.18: icmp_seq=1 ttl=128 time=21.0 ms
^C64 bytes from 39.156.66.18: icmp_seq=2 ttl=128 time=25.4 ms
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 10028ms
rtt min/avg/max/mdev = 20.962/23.187/25.413/2.225 ms
【至此,kali使用dhcp分配IP地址实验完成】