Kali Linux configure network manually a Complete Guide for beginners

How ot do Kali Linux network configuration

Hello and welcome on my blog, there Vijay Kumar, 

This article about the ” Kali Linux configure network manually ” In this topic, I will cover all about the Kali Linux network configuration of LAN (Ethernet) and Wireless LAN adapter as well. After reading this article you will able to assign IP manually and by DHCP server as well.

Kali Linux Network Configuration for Ethernet Connection

Network interfaces (LAN adapter, wireless adapter, usb adapter, fast Ethernet) are responsible to connect and make communication between two or more computers in a network.

If the network card is not configured properly, then you are out of network and configuration is important for network security. The network should have proper IP Address, subnet mask, Default gateway, domain name server, etc.

So configure the network and get into the network. but the most important question:

How do you check the Kali Linux network configuration?

There are different methods for windows and Linux operating systems. Here we are discussing Kali Linux, I will explain tasks used in Linux. Following command is used to check the status of the networking cards in Kali Linux:

Before run command makes sure, you are working as root. I mean “You must be root to make changes in network configuration.

If you are checking only network configuration then you don’t have a need to be root.

$sudo ifconfig

$sudo ifconfig –a

vijay@kali:~$sudo ifconfig -a
eth0: flags=4163  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fec6:ebc6  prefixlen 64  scopeid 0x20
        ether 08:00:27:c6:eb:c6  txqueuelen 1000  (Ethernet)
        RX packets 4  bytes 930 (930.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27  bytes 2313 (2.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 20  bytes 1036 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 1036 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
vijay@kali:~$
vijay@kali:~$ sudo ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fec6:ebc6  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:c6:eb:c6  txqueuelen 1000  (Ethernet)
        RX packets 4  bytes 930 (930.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27  bytes 2313 (2.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 20  bytes 1036 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 1036 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

You have seen the result of ifconfig command, You can see assigned IP address, MAC address, Netmask, for IPv4, etc.

You can run this command as a normal user, sudo user, or root user. If you didn’t create a normal user in Kali Linux then you are using the system by the root user.

Enable/Disable network interface cards

Sometimes you find that network interface is not responding properly, you will have to enable and disable.

You have more than 1 interface, and you want to use only 1 adapter, then disable other adapters.

You can use Ifconfig command followed by up option and interface name to start the network interface and for stopping it use the down option.

You can use the following syntax to enable and disable network interface cards.

#ifconfig eth0 down

#ifconfig eth0 up

vijay@kali:~$sudo ifconfig eth0 down
vijay@kali:~$udo ifconfig
lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 20  bytes 1036 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 1036 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vijay@kali:~$

Assign IP Address for the network (eth0 or wlan0)

Eth0 is the number of a wired network interface card. if you want to assign IP address for wireless adapter replace eth0 by wlan0. The current configuration of this adapter can be changed by using the following command and this command will assign new IP address for your computer interface

$sudo ifconfig eth0 192.168.1.10

vijay@kali:~$sudo ifconfig eth0 192.168.1.10
vijay@kali:~$usudo ifconfig
eth0: flags=4163  mtu 1500
        inet 192.168.1.10  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a00:27ff:fec6:ebc6  prefixlen 64  scopeid 0x20
        ether 08:00:27:c6:eb:c6  txqueuelen 1000  (Ethernet)
        RX packets 15013  bytes 14434124 (13.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8200  bytes 881820 (861.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 184  bytes 14152 (13.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 184  bytes 14152 (13.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


vijay@kali:~$

Kali Linux network configuration with IP address and Netmask

Netmask is used to indentify the network address. It can be configured by using given command. This will set the ip address 192.168.1.10 and set the subnet mask 255.255.255.0

$sudo ifconfig eth0 192.168.1.10 netmask 255.255.255.0

vijay@kali:~$sudo ifconfig eth0 192.168.1.10 netmask 255.255.255.0
vijay@kali:~$usudo ifconfig
eth0: flags=4163  mtu 1500
        inet 192.168.1.10  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::a00:27ff:fec6:ebc6  prefixlen 64  scopeid 0x20
        ether 08:00:27:c6:eb:c6  txqueuelen 1000  (Ethernet)
        RX packets 15013  bytes 14434124 (13.7 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 8200  bytes 881820 (861.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 184  bytes 14152 (13.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 184  bytes 14152 (13.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


vijay@kali:~$

Add default gateway

Default gateway is added or changed, by using following command. It will set the default gateway 192.168.1.1

#route add default gw 192.168.1.1
OR
$sudo route add default gw 192.168.1.1

Add dns-namesevers

In Linux Domain Name Server or DNS can be set or modifying the resolv.conf  in the /etc directory. It can be changed by editing this file. add the following sytex in terminal

#echo nameserver 8.8.8.8 > /etc/resolv.conf

This command will remove the current nameserver and set 8.8.8.8. It can be added alternate nameserver by using following syntax

#echo nameserver 4.4.4.4 >> /etc/resolv.conf

Kali Linux network configuration from DHCP 

DHCP services are one of the easiest ways to configure an Ethernet. A free DHCP server provides all required configuration settings for the network cards. Use the following method:

#leafpad /etc/networking/interfaces

make these entries

auto eth0

iface eth0 inet static

address {ip_Address}

netmask {netmask}

gateway {Default_gateway_IP_Address}

Save the file and exit to complete the modification. It is required to take down the network and again bring up Ethernet interfaces to applying this configuration.

Use the following command to configure the network adapter
#dhclient eth0

This will configure the network adapter using the settings provided by the DHCP Server.

How to Configure Network Manually in Kali Linux Video Guide

If Appreciate My Work, You should consider:

18 thoughts on “Kali Linux configure network manually a Complete Guide for beginners

  1. I’m really enjoying the theme/design of your web site. Do you ever run into any internet browser compatibility issues? A number of my blog audience have complained about my site not working correctly in Explorer but looks great in Firefox. Do you have any suggestions to help fix this issue?

  2. Am upgrade my kali Linux but
    Open network connection
    Error
    (The system network service are not compatible with this version)
    Hiw to fix this problem

  3. My kali linux is not accepting the command “ifconfig”. It is showing “bash: ifconfig: command not found” Please help me out from this problem.

  4. sir, i am unable to access the Internet, though it shows m conneted to wifi.. tried all the steps above but problem persists.

    1. If you are connected to internet and not able to access to internet, IT is happened when your name server is not configured proper. Please make sure you have configure nameserver properly

      1. sir i have exactly done that was instructed by you i checked nameserver several times.. its correct but still facing the issue.. plzz help

  5. I wanted to prepend my dhcp settings.

    I went to: # nano /etc/dhcp/dhclient.conf

    Here I go down and find this commented line:

    #prepend domain-name-servers 192.168.0.1;

    I remove the comment (#) and enter the following to use “openDNS”:

    prepend domain-name-servers 208.67.222.222,208.67.220.220;

    I then use “CTRL+ o” to save then “CTRL + x” to EXIT nano editor

    I then ran:
    #service network-manager restart

    Receive:
    #Failed to restart network-manager.service: Unit network-manager.service not found.

    So I ran:
    #service NetworkManager stop
    #service NetworkManager start

    #cat /etc/resolv.conf

    # Generated by NetworkManager
    nameserver 192.168.0.1

    I even tried:
    #echo 208.67.222.222 > /etc/resolv.conf
    #echo 208.67.220.220 >> /etc/resolv.conf
    #echo 192.168.0.1 >> /etc/resolv.conf

    When you ‘cat’ this is shows correct, but as soon as the NetworkManger service restarts, or you reboot, resolv.conf reverts back to only containing 192.168.0.1 ? I’ve watched YouTube and your method and I cannot get this to work!

    I am running Kali Linux 2020.4 installed directly on a laptop, no VM.

  6. Hello! Sir my mobile hotspot is not connecting to kali linux machine.
    I start network manager but is not not working even in bridge mode.
    I tried many ways and run many commands about service but it is working.
    #command: service network manager restart
    Output:
    network: unrecognized service
    Please help me to solve this problem.

Leave a Reply

Your email address will not be published.