How to assign an IP address under Linux?

April 2017


How to assign an Ip address under Linux?




Issue


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

Solution

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

Related


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 (ccm.net).