Help us understand the problem. What is going on with this article?

ipアドレスを変更する方法

環境

RedHat Enterprise Linux 7.7

ipアドレスを変更するには?

viコマンドの利用

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

やり方

①ファイルの中身を確認します

# cat /etc/sysconfig/network-scripts/ifcfg-eth0

②ファイルの中身を書き換えます

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

③再起動します

# reboot

④変更が反映されているのかを起動後に確認します。確認コマンドは下記の通りです。

# ip a

因みにAWSでは変更できません。下記のように表示されました。

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=dhcp
DEVICE=eth0
HWADDR=0X:XX:XX:XX:XX:XX
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
 ※数字部分はXと記載しています

引用

LinuxのIPアドレスを変更する

http://www.searchman.info/tips/1350.html

以上がIPアドレスの変更方法です。
最後までお読みいただきありがとうございました!

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away