How to modify ip address in linux
How to modify the ip address in linux? This problem may be often seen in our daily work. Through this question, I hope you can gain more. Let's take a look at the solution with the editor today.
You can modify the ip address by modifying the configuration file.
1. Modify eth0 configuration file
[root@lnode1 ~] # cd / etc/sysconfig/network-scripts/TYPE=EthernetPROXY_METHOD=none / / modify BROWSER_ONLY=noBOOTPROTO=noneDEFROUTE=yesIPV4_FAILURE_FATAL=noIPV6INIT=yesIPV6_AUTOCONF=yesIPV6_DEFROUTE=yesIPV6_FAILURE_FATAL=noIPV6_ADDR_GEN_MODE=stable-privacyNAME=eth0UUID=4f5f8b5d-4b51-4e1c-98c7-40f0eb90f241DEVICE=eth0 ONBOOT=yes / / modify IPADDR=192.168.4.12 / / modify PREFIX=24 / / modify
Second, modify the eth2 configuration file
First add the network card
[root@lnode1 ~] # nmcli connection add con-name eth2 ifname eth2 type ethernet / / add the network card first
Then modify the configuration file in the same way as the eth0 configuration file.
3. Restart the network card service
[root@lnode1 ~] # systemctl restart NetworkManager
These are the specific operations of changing the ip address in linux, the content is more comprehensive, and I also believe that there are quite some tools that we may see or use in our daily work. Through this article, I hope you can gain more.