Sunday 8 February 2015

Using The Command Line To Configure Network Interface In Kali Linux

It is important to configure network adapter. Command prompt is useful not using graphical interface in Kali Linux. Configuring network interface will needed root permission, changing by normal user. Once normal user have permission network card can be configured.
Following command is used to check the status of the network card in Kali Linux:
#ifconfig
#ifconfig –a
Using The Command Line To Configure Network Interface In Kali Linux _image1

Starting and stopping the interface

Ifconfig command using the up option can start network interface and stopped using the down option. Following syntax is used
#ifconfig eth0 down
#ifconfig eth0 up
Using The Command Line To Configure Network Interface In Kali Linux _image2

Using The Command Line To Configure Network Interface In Kali Linux _image3

Change configuration of network (eth0)

Eth0 is the number of Ethernet adapter. The current configuration of this adapter can be changed by using following command.
#ifconfig eth0 192.168.1.10

Configure network adapter 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
#ifconfig eth0 192.168.1.10 netmask 255.255.255.0
Using The Command Line To Configure Network Interface In Kali Linux _image4

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
Using The Command Line To Configure Network Interface In Kali Linux _image5

Add Name Server

In Linux Name Server or DNS can be set by modifying the resolv.conf in the /etc directory. It can be changed by editing this file. Syntax
#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

DHCP from the Command Prompt

DHCP services is one of the easiest ways to configure a Ethernet. DHCP server provides all required configuration setting for network card. 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 modification. It is required to take down network and again bring up Ethernet interfaces to applying this configuration.
Use following command to configure network adapter
#dhclient eth0

No comments:

Post a Comment