After the Kali Linux installation is complete, its network needs to be configured. Using a DHCP service is one of the easiest ways to configure a NIC, but it is not usually done when penetration testing because the system is logged in the DHCP server's database.
1 Dynamic DHCP mode
Configuration file Address:
/etc/network/interface
# Start System activation device
# Loop loopback Address
Auto Lo
Iface Lo inet Loopback
# Start System activation device
# NIC Eth0 set to DHCP type
Auto Eth0
Iface eth0 inet DHCP
2 statically static mode
# Start System activation device
# Loop loopback Address
Auto Lo
Iface Lo inet Loopback
# Start System activation device
# NIC Eth0 set to static type
Auto Eth0
Iface eth0 inet Static
# Specify IP address, subnet mask, gateway
Address 192.168.0.111
Netmask 255.255.255.0
Gateway 192.168.0.1
Note: When configuring the IP address parameters, the "Dynamic DHCP mode" and "Static-static mode" can only take one of them, they can not exist at the same time, remember!!
3 DNS Server settings
Configuration file Address:/etc/resolv.conf
# must be set. Otherwise you can't surf the internet
NameServer 192.168.0.1
4 Restart the NIC
/etc/init.d/networking restart
Ifdown eth0
Ifup eth0
Sometimes you may need to restart the virtual machine.
5 FAQ5.1 After the configuration is complete, unable to surf the internet
It can be used to ping the gateway and other machines within the LAN, but it is not possible to surf the Internet, because the gateway is misconfigured.
Gateway 192.68.0.1
Kali post-Installation network settings