IP Address Configuration in Kali Linux

IP Address Configuration in Kali Linux

 

Kali is built on Debian platform, in our configuration guide we are going to cover IP address configuration in Kali Linux .

IP address configuration in Kali Linux – Steps

1. IP address configuration in kali linux Static and Dynamic.

2. Virtual Interface and Virtual IP configuration configuration in Kali Linux.

3. How to change hostname and how to add route in Kali Linux

1. IP address configuration in Kali Linux (Static and Dynamic).

IP address configuration in Kali Linux , there are two methods (static / dynamic)  By default Kali Linux uses DHCP settings , The network configuration file locates in /etc/network/interface.
firstly you need to check out how many network card installed in box by issuing below command.

#ifconfig -a

Below parameter require for dynamic IP from DHCP server

#vi /etc/network/interfaces

auto eth0
allow-hotplug eth0 # detect link
iface eth0 inet dhcp #  using DHCP method

Save & Exit!

Use below command to restart network service to reflect the changes made in

#/etc/init.d/networking restart
or
#service networking restart

Below parameter require for loopback address, it’s default (127.0.0.1).

auto lo
iface lo inet loopback

Below parameter require for static IP configuration , we assume that only one network card installed, if you have more than one you can use different IP to each of the network card. the label for network cards will be like eth0 ,eth1…

#vi /etc/network/interface

auto eth0 #interface name
allow-hotplug eth0 #link detection
iface eth0 inet static # define IPV4 the ip using static method
address 192.168.0.252 # IP address
netmask 255.255.254.0 # subnet mask
gateway 192.168.0.253 # gateway (router)

Save & Exit!

Use below command to restart network service to reflect the changes made in

#/etc/init.d/networking restart
or
#service networking restart

Below parameter require for IPV6

iface eth0 inet6 static
address fe80::c0a8:fc
netmask fe80::c0a8:0
gateway fe80:0:0:0:0:0:c0a8:fe

Use below command to set networking service on at boot .

# update-rc.d networking enable

Use below configuration file to add name servers , you must have this settings in order to communication external network through host name like www.google.com, something.com , mail.yahoo.com.

Append following file to add name server details.

# vi /etc/resolv.conf

nameserver 192.168.0.33 #internal DNS server
nameserver 8.8.8.8 #public DNS server

Save & Exit.

Verify dns settings are working properly , use below useful commands .

#dig google.com
#host google.com
#get www.google.com

Change the interface status , bring it UP / Down

#ifconfig eth0 down
#ifocnfig eth0 up

2. Virtual Interface and Virtual IP configuration configuration in Kali Linux.

Virtual IP, assigning multiple IP to an interface.

Create a virtual interface and assign an IP address within the network or other network. A virtual interface can have IP address of different network than physical interface.

You can create any number of virtual interface and each one can have IP of same network / other network.
#ifconfig eth0:1 192.168.200.1 netmask 255.255.255.0 up

Note : eth0:1 (eth0 is physical , :1 is virtual interface identifier number)

Example :
eth0:1
eth0:2
eth0:3 ….

#vi /etc/network/interface

#                               physical interface settings

auto eth0 #interface name
allow-hotplug eth0 #link detection
iface eth0 inet static # define IPV4 the ip using static method
address 192.168.0.25 # IP address
netmask 255.255.255.0 # subnet mask
gateway 192.168.0.1 # gateway (router)

#                                     virtual  interface settings

auto eth0:1

allow-hotplug eth0 #link detection
iface eth0 inet static # define IPV4 the ip using static method
address 192.168.0.26 # IP address
netmask 255.255.255.0 # subnet mask

auto eth0:2
allow-hotplug eth0 #link detection
iface eth0 inet static # define IPV4 the ip using static method
address 192.168.0.27 # IP address
netmask 255.255.255.0 # subnet mask

auto eth0:3
allow-hotplug eth0 #link detection
iface eth0 inet static # define IPV4 the ip using static method
address 192.168.0.26 # IP address
netmask 255.255.255.0 # subnet mask

Save & Exit!

Use below command to restart network service to reflect the changes made in

#/etc/init.d/networking restart
or
#service networking restart

3. How to change hostname and how to add route in Kali Linux

use below configuration file to change hostname

#vi /etc/hostname
#invoke-rc.d hostname.sh start

reconnect the ssh session to verify hostname status.

 

IP Address Configuration in Kali Linux covered following topics.

IP address configuration (Static and Dynamic) in Kali Linux
Virtual IP and Virtual interface configuration in Kali Linux
How to change hostname in Kali Linux

 

Watch:

Both comments and pings are currently closed.

Comments are closed.

Copyright ©Solutions@Experts.com
Copyright © NewWpThemes Techmark Solutions - www.techmarksolutions.co.uk