How to assign an IP address under Linux?

April 2018

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.
Published by aakai1056. Latest update on July 11, 2011 at 09:09 AM by aakai1056.
This document, titled "How to assign an IP address under Linux?," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (
Linux - How to access the system log using command line?
Ubuntu/Debian - MAN pages in French