Linux command line to modify IP 2 methods

  
                  

This article describes how to modify the IP through the Linux command line. Modifying the IP through the Linux command line can be implemented in the following two ways.

Method 1:

ifconfig eth0 192.168.1.18 netmask 255.255.255.0

Description: This method can make the change take effect immediately, and it will be restored to the original IP after restart. Br>

Method 2:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Description: This method takes effect after reboot and is permanent

If you want to change it immediately and it will take effect permanently, you can only use it in both ways.

The above is the way to modify the IP through the linux command line.

Copyright © Windows knowledge All Rights Reserved