root@kali:~# service networking restart [....] Running /etc/init.d/networking restart is deprecated because it may not r[warnble some interfaces ... (warning). [....] Reconfiguring network interfaces...Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/eth0/00:0c:29:e2:03:ff Sending on LPF/eth0/00:0c:29:e2:03:ff Sending on Socket/fallback DHCPRELEASE on eth0 to 192.168.1.1 port 67 Reloading /etc/samba/smb.conf: smbd only. Internet Systems Consortium DHCP Client 4.2.2 Copyright 2004-2011 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/eth0/00:0c:29:e2:03:ff Sending on LPF/eth0/00:0c:29:e2:03:ff Sending on Socket/fallback DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 14 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 19 No DHCPOFFERS received. No working leases in persistent database - sleeping. done.
結果如上圖, 筆者用的是VMWare, 運行的是Kali Linux, 但願用橋接模式經過路由器獲取動態IP, 可是不管如何也不能正確獲取IP地址.oop
一點點排查spa
1. 排查DNSrest
root@kali:~# cat /etc/resolv.conf nameserver 192.168.1.1 nameserver 114.114.114.114
192.168.1.1在裏面, DNS設置沒有問題code
2. 排查網卡orm
root@kali:~# cat /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
auto eth0 iface eth0 inet dhcp
網卡自動激活, 並配置dhcp獲取IP方式server
3.排查VMWare 橋接設置blog
因爲筆者裝有Virual Box & VMWare Workstation, 因此有多個虛擬網卡, 橋接爲自動模式, 心想是否是自動橋接到不能連外網的Virtual Box的虛擬網卡了?路由
果斷選成實際外網網卡, 重啓Kali Linux networking服務, 問題解決.it
root@kali:~# service networking restart
[....] Running /etc/init.d/networking restart is deprecated because it may not r[warnble some interfaces ... (warning).
[....] Reconfiguring network interfaces...Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/00:0c:29:e2:03:ff
Sending on LPF/eth0/00:0c:29:e2:03:ff
Sending on Socket/fallback
DHCPRELEASE on eth0 to 192.168.1.1 port 67
send_packet: Network is unreachable
send_packet: please consult README file regarding broadcast address.
Reloading /etc/samba/smb.conf: smbd only.
Internet Systems Consortium DHCP Client 4.2.2
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/eth0/00:0c:29:e2:03:ff
Sending on LPF/eth0/00:0c:29:e2:03:ff
Sending on Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPOFFER from 192.168.1.1
DHCPACK from 192.168.1.1
Reloading /etc/samba/smb.conf: smbd only.
bound to 192.168.1.101 -- renewal in 3353 seconds.
done.