How to set or change IP address in Linux – Linux IP Administration

Linux

How to set IP Address in Linux

  • Using setup command configure IP address
  • Using ifconfig command check the status
  • Modifying ifcfg-ethX file

File path /etc/sysconfig/network-scripts/

Steps:

Open terminal, run setup command. Below screen will appear.

setup-com-1

Select network configuration. Below screen will appear

setup-com-2

Select Device configuration. Below screen will appear, you will see the ethernet interfaces

setup-com-3

Select the interface you want to set IP address. We select eth0 , below screen appear

setup-com-4

remove DHCP by pressing spacebar, you can change the selection using arrow key. After modification select Ok and press enter to save the data

setup-com-5

Select save and press enter to save the device

setup-com-6

Select save & quite

setup-com-7

Select Quit to exit from the setup utility.

Now run ifconfig command to check the IP and interface status and its showing that IP not updated yet

setup-com-8

Go to the location /etc/sysconfig/network-scripts/

modify the file ifcfg-eth0 using vi ifcfg-eth0

setup-com-9

press i to modify the file, comment the NM_CONTROLLED line. Update yes for ONBOOT and save the file using esc and write “:wq” press enter to save and quite the file.

setup-com-10

To check the hands on visit the below you tube video