How to assign an IP address under Linux?

October 2016

How to assign an Ip address under Linux?


I want to know how can i assign or modify Ip address or submask under Linux?


  • To define or modify IP addresses of "eth0" interface while giving it "" as value, you should type the following command line:
  • "
    ifconfig eth0
  • To change the mask and to fix it's the value at "", the command line is:
     ifconfig eth0 netmask 
  • To check your configuration, you can type "
    ifconfig - a
    " which will show you the configuration of all your networks chart.

Related :

This document entitled « How to assign an IP address under Linux? » from CCM ( is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.