自宅のL2 Switch

Catalyst 2960S (WC-2960S-24TS-L)を買ったはいいけど
やっぱファンの音五月蠅いからお蔵入り・・・

Catalyst 2960Gの時も、結局ファンの音に我慢できずにお蔵入りしたな(遠い目

Ruckus APあるので、PoE Switchで 16Portクラスが欲しいのだけど
16Port PoEになると、高い、ファン付きになるということで
Netgear GS116v2 + GS108PEv3 の組み合わせに戻った・・・

PoE Switch使わずに、ACアダプターかPoE Injector使えば?となるが
どうせコンセント1口使うなら、スイッチでいいやと

GS116v2はこのクラスにしてはbuffer sizeが大きく512KB/Portと
大きなファイル転送でもそれなりのパフォーマンスを発揮してくれるので
(安いスイッチだと 512KB/unitとか普通にあるので)

Nginxの fastcgi_temp Warning対策とPHP-FPMの接続にUNIX Socketを使用する

Nginx と PHP-FPMの接続は http://127.0.0.1:9000/ を使用しているので
UNIX Socketに変更するとスマートになるんではないかなと

/etc/php-fpm.d/www.conf

listen = /var/run/php-fpm/php-fpm.sock

listen.owner = nginx
listen.group = nginx
listen.mode = 0660

に変更して、再起動してソケットファイルの確認

# systemctl restart php-fpm
# ls -la /var/run/php-fpm/
total 4
drwxr-xr-x  2 root  root   80 Sep 21 04:20 .
drwxr-xr-x 25 root  root  720 Sep 21 04:20 ..
-rw-r--r--  1 root  root    5 Sep 21 04:20 php-fpm.pid
srw-rw----  1 nginx nginx   0 Sep 21 04:20 php-fpm.sock

nginx の conf を

fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;

に修正して、reload

# systemctl reload nginx

アクセスしてみて問題なければOK

ちなみに自分専用のWebサイトレベルなので、レスポンスタイムが短縮したなんて事は体感できず(苦笑

ついでにアクセスするたんびに出力されていた

an upstream response is buffered to a temporary file /var/cache/nginx/fastcgi_temp/7/00/0000000007 while reading upstream, client: xxx.xxx.xxxxxx, server: xxx.xxx.jp, request: "GET /index.php HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "xxx.xxx.jp", referrer: "https://xxx.xxx.jp/"

も消えた\( ̄∇ ̄)/
(まあ、理由考えれば当然なんだろうけど)

ZabbixのHTTPを httpd -> Nginxに変更する

一通り CentOS7 + MySQL 5.7 + Zabbix 3.4 + PHP 7.x で構築できたので
今更な Apache(httpd)じゃなくて、他のサーバーでも使っている Nginx に変更

1. Zabbix Server と httpd の停止
# systemctl stop zabbix-server
# systemctl stop httpd
2. Nginxのインストール

Nginxのサイトにしたがい https://nginx.org/en/linux_packages.html#mainline
mainlineのレポジトリを追加

# cat > /etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=0
enabled=1
<ここで Ctrl+D で出力終了>
# chmod 644 /etc/yum.repos.d/nginx.repo
#
# yum install nginx

nginxを起動してWelcomページが表示されるか確認

# systemctl start nginx

ブラウザから、サーバーのIPを叩いて表示されること
https://i.imgur.com/tD0jR4Y.png

3. PHPのモジュールをインストール

既に入っているものもあるが、次回構築時に判るようにするために

# yum install php-mbstring php-pdo php-xml php-zip php-fpm php-mysqlnd
4. PHP-fpmの設定変更

apach向けになっているので、Nginxに変更

# vi /etc/php-fpm.d/www.conf
user = nginx
group = nginx

セッションファイルのディレクトリのパーミッション変更

# chown -R nginx:nginx /var/lib/php/session/

PHP-fpmの起動

# systemctl start php-fpm
5. Nginxの設定変更

/etc/nginx/conf.d 以下のdefault.conf をコピーして修正する
default.conf については、conf.bak などにリネームしておかないと /zabbix/ では失敗する

http://www.hogehoge.com/ で表示させる場合と
httpd の時と同様に http://www.hogehoge.com/zabbix/ で表示させる方法があるのだが
どちらが良いのかイマイチわからない

取り敢えず今回は後者の config

# cp -p /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/zabbix.conf
# vi /etc/nginx/conf.d/zabbix.conf
    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    location /zabbix {
        alias   /usr/share/zabbix;
        index  index.php;
        if (!-e $request_filename) {
            rewrite ^/zabbix(.+)$ /zabbix/index.php?q=$1 last;
            break;
        }
    }

    location ~ ^/zabbix/.+\.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_split_path_info ^/zabbix(.+\.php)(.*)$;
        fastcgi_param  SCRIPT_FILENAME  /usr/share/zabbix$fastcgi_script_name;
        include        fastcgi_params;
    }

パーミッションを変更

# chown nginx:nginx /etc/zabbix/web
# chown nginx:nginx /etc/zabbix/web/zabbix.conf.php
6. Nginx再起動とZabbix Server起動
# systemctl reload nginx
# systemctl start zabbix-server
7. 自動起動設定
# systemctl disable httpd
# systemctl enable nginx
# systemctl enable php-fpm
8. http://www.hogehoge.com/ で起動する nginx conf

こちらで運用する場合もあるので記述

# vi /etc/nginx/conf.d/zabbix.conf
    location / {
        root   /usr/share/zabbix;
        index  index.php;
    }

    location ~ \.php$ {
        root           /usr/share/zabbix;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

こっちのほうがお手軽なので、これでもいいかなあと

CentOS7をZabbixで監視する

Zabbix Serverの構築はできたので
取り敢えず Linux (CentOS) Agentを入れて、Linux Templateまで適用してみようかと

1. Zabbix Repositoryを導入

https://www.zabbix.com/jp/download ここから、Repositoryを選択して

# rpm -i https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.VSZpP1: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY
#
# yum repolist
zabbix/x86_64                Zabbix Official Repository - x86_64                                223
zabbix-non-supported/x86_64  Zabbix Official Repository non-supported - x86_64                    4
2. Zabbix Agentのインストール
# yum info zabbix-agent
Available Packages
Name        : zabbix-agent
Arch        : x86_64
Version     : 3.4.14
Release     : 1.el7
Size        : 367 k
Repo        : zabbix/x86_64
Summary     : Zabbix Agent
URL         : http://www.zabbix.com/
License     : GPLv2+
Description : Zabbix agent to be installed on monitored systems.
#
# yum install zabbix-agent

GPG KEYの警告がでるけど、「Y」をおして Agentをインストール

3. zabbix_agentd.conの修正

環境に合わせて以下を修正する

# vi /etc/zabbix/zabbix_agentd.conf
server=<Zabbix Server IP>
ServerActive=<Zabbix Server IP>
HostnameItem=system.hostname <- 有効化
4. Zabbix Agentの起動と自動起動設定
# systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
#
# systemctl start zabbix-agent
# systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-09-18 02:21:12 JST; 1s ago
  Process: 2480 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
 Main PID: 2482 (zabbix_agentd)
   CGroup: /system.slice/zabbix-agent.service
           tq2482 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           tq2483 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
           tq2484 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
           tq2485 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
           tq2486 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
           mq2487 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

Sep 18 02:21:12 rep2 systemd[1]: Starting Zabbix Agent...
Sep 18 02:21:12 rep2 systemd[1]: PID file /run/zabbix/zabbix_agentd.pid not readable (yet?) a...art.
Sep 18 02:21:12 rep2 systemd[1]: Started Zabbix Agent.
Hint: Some lines were ellipsized, use -l to show in full.
#
# systemctl enable zabbix-agent
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.
#
# systemctl status zabbix-agent
● zabbix-agent.service - Zabbix Agent
   Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-09-18 02:21:12 JST; 3min 12s ago
 Main PID: 2482 (zabbix_agentd)
   CGroup: /system.slice/zabbix-agent.service
           tq2482 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
           tq2483 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
           tq2484 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
           tq2485 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
           tq2486 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
           mq2487 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]

Sep 18 02:21:12 rep2 systemd[1]: Starting Zabbix Agent...
Sep 18 02:21:12 rep2 systemd[1]: PID file /run/zabbix/zabbix_agentd.pid not readable (yet?) a...art.
Sep 18 02:21:12 rep2 systemd[1]: Started Zabbix Agent.
Hint: Some lines were ellipsized, use -l to show in full.
#
5. Zabbix Server <-> Agentの疎通確認

zabbix_get コマンドを使用して、Agentと通信できることを確認する
Zabbix Serverで以下を実行

# zabbix_get -s <Agent IP> -k system.hostname <- Agentのホスト名
# zabbix_get -s <Agent IP> -k agent.version <- AgentのVer
6. Zabbix Serverに登録

あとはよしなに

CentOS7 + Zabbix + MySQL その3

Zabbixの起動画面は辿り付いたので
取り敢えず Setupを実行してみる
https://i.imgur.com/6yM2fqH.png

Check of pre-request で PHPのパラメーターで Failしているので、PHPの設定を変更する
https://i.imgur.com/QiYHDWg.png

/etc/php.ini をZabbixが要求する値に修正して httpdを再起動

# vi /etc/php.ini
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone = Asia/Tokyo
#
# systemctl restart httpd

https://i.imgur.com/7c34QGR.png

MySQLの設定を入力
https://i.imgur.com/KUBxo9I.png

https://i.imgur.com/CTY1v0R.png

https://i.imgur.com/c0Ppp1R.png

インストール完了\( ̄∇ ̄)/
https://i.imgur.com/xURC8qA.png

デフォルトは
Username : Admin
Password : zabbix
でログインしましょう!
https://i.imgur.com/vxMMmKu.png

CentOS7 + Zabbix + MySQL 本題その2

1. Zabbixリポジトリを追加

で、ようやく本題のZabbixインストールまでたどり着いたわけだが(苦笑

標準/EPELリポジトリのZabbixはVerが古い為にZabbixのサイトからリポジトリを追加
https://www.zabbix.com/jp/download

Zabbix Ver : 3.4
OS : CentOS
OS Ver : 7
Database : MySQL
リポジトリを選択

# rpm -i https://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.ZQQqQO: Header V4 RSA/SHA512 Signature, key ID a14fe591: NOKEY

Signature Warningが出るが問題は無し

# yum repolist
zabbix/x86_64                       Zabbix Official Repository - x86_64                          223
zabbix-non-supported/x86_64         Zabbix Official Repository non-supported - x86_64              4

Zabbix Official RepoがInstallされていることを確認

2. Zabbix Server / Agentインストール

zabbix-web-japaneseは、Webで日本語フォントを使えるようにする為に必要
zabbix-getは、zabbix-agetとの疎通確認にも使うのでいれておくrp

# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
# yum install zabbix-web-japanese
# yum install zabbix-get
3. MySQLのZabbix初期設定
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<パスワード>';
mysql> quit; 
4. 初期データとスキーマのインポート
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter Password:
#
5. Zabbix Server と MySQLの接続設定

/etc/zabbix/zabbix_server.conf のDBPasswordを設定
125行目あたりに追記

DBPassword=<パスワード>
6. PHPのTIMEZONE変更

/etc/httpd/conf.d/zabbix.conf の PHP TIMEZONEを修正

# php_value date.timezone Europe/Riga

これを

php_value date.timezone Asia/Tokyo
7. Zabbix Server/Agent起動
# systemctl restart zabbix-server zabbix-agent httpd
# systemctl enable zabbix-server zabbix-agent httpd 
8. http://Server IP or Hostname/zabbix/ にアクセス

https://i.imgur.com/6yM2fqH.png

CentOS7 + Zabbix + MySQL (Zabbixインストールする前に)

Zabbixインストールするまでの、PHP / MySQLのインストールと初期設定で長くなったので
今回はそれまでの前振りということで _no

自宅内Network機器のトラフィック見たりするのに
Zabbixのグラフ機能使ってみようかなと思ってみたりしたので

CentOS7はminimalでインストール完了
EPELリポジトリも Installしている状況
1. ユーザー作成
2. sshdの設定変更
3. chrony 導入
4. 不要サービスの停止

但し、CentOS7では、PHPは5.x系、MySQLはインストールされておらず互換DBのMariDB Liblaryがインストールされている

1. PHP 7.x系のインストール
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

PHP 7.3のrepoを有効化
(今回 7.3を使用しているが現時点ではRCなので、7.2のほうが良いと思われる)

# vi /etc/yum.repos.d/remi-php73.repo
# sdiff -s /etc/yum.repos.d/remi-php73.repo /etc/yum.repos.d/remi-php73.repo.20180917
enabled=1                                                     | enabled=0
# yum repolist
remi-php73                    Remi's PHP 7.3 RPM repository for Enterprise Linux 7 - x86_64      219
remi-safe                     Safe Remi's RPM repository for Enterprise Linux 7 - x86_64       3,015

これでupdateを実行すると、PHP 5,x が PHP 7.3系にUpdateされる

# yum update
2. MySQL 5.7のインストール

MariaDBのライブラリが導入されているので、バッティングを防ぐ為に削除する

# rpm -qa | grep maria
mariadb-libs-5.5.60-1.el7_5.x86_64
# yum remove mariadb-libs-5.5.60-1.el7_5.x86_64
# rm -rf /var/lib/mysql/

MySQLリポジトリ追加

# yum install http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
# yum repolist
mysql-connectors-community/x86_64 MySQL Connectors Community                                      65
mysql-tools-community/x86_64      MySQL Tools Community                                           69
mysql57-community/x86_64          MySQL 5.7 Community Server                                     287

MySQL Serverインストール

# yum install mysql-community-server

インストールされた MySQL Serverの自動起動設定の確認と起動
基本自動起動は enableになってるっぽい??

# systemctl list-unit-files --type service | grep mysql
mysqld.service                                enabled
mysqld@.service                               disabled
#
# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
# systemctl start mysqld
# systemctl status mysqld
● mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-09-17 03:08:35 JST; 11s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 10265 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
  Process: 10192 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 10268 (mysqld)
   CGroup: /system.slice/mysqld.service
           mq10268 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

Sep 17 03:08:08 zabbix systemd[1]: Starting MySQL Server...
Sep 17 03:08:35 zabbix systemd[1]: Started MySQL Server.

無事起動!!

rootユーザーの初期パスワードは構築時にランダムで設定され /var/lib/mysqld.log に出力されている

# grep password /var/log/mysqld.log
2018-09-16T18:08:21.211929Z 1 [Note] A temporary password is generated for root@localhost: sE7P&KJweq4H
3. MySQLの初期設定

MySQL では最低限のセキュリティ設定をしてくれる mysql_secure_installation なるツールがあるのでそれを実行

具体的には

  • root ユーザーのパスワードの変更
  • VALIDATE PASSWORD プラグインのインストール
  • ポリシーに沿った root ユーザーパスワードの設定 (VALIDATE PASSWORD プラグインをインストールした場合)
  • anonymous ユーザーの削除
  • リモートホストから root ユーザーでログインするのを禁止する
  • testデータベースの削除 (存在する場合)
# mysql_secure_installation
Securing the MySQL server deployment.

Enter password for user root:

New password:

Re-enter new password:
 ... Failed! Error: Your password does not satisfy the current policy requirements

New password:

Re-enter new password:
The 'validate_password' plugin is installed on the server.
The subsequent steps will run with the existing configuration
of the plugin.
Using existing password for root.

Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) : y

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Success.

By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
 - Dropping test database...
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
Success.

All done!

なんか、パスワードのセキュリティ強度が最初から middleになっとった _no

自宅内でし使わないのにこんな強度いらないということで

# mysql -uroot -p
Enter Password:
mysql> show variables like 'validate_password%';
+--------------------------------------+--------+
| Variable_name                        | Value  |
+--------------------------------------+--------+
| validate_password_check_user_name    | OFF    |
| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | MEDIUM |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+
7 rows in set (0.00 sec)

mysql> set global validate_password_policy=LOW;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'validate_password%';
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password_check_user_name    | OFF   |
| validate_password_dictionary_file    |       |
| validate_password_length             | 8     |
| validate_password_mixed_case_count   | 1     |
| validate_password_number_count       | 1     |
| validate_password_policy             | LOW   |
| validate_password_special_char_count | 1     |
+--------------------------------------+-------+
7 rows in set (0.00 sec)

mysql> set password = password('<新しいパスワード>');

MySQL からデフォルトのパスワード有効期限が 360日になったので、無期限に
ついでに文字コードについても UTF-8 を初期値にするように [mysqld] セレクションに追加

# vi /etc/my.cnf
# cat /etc/my.cnf
<省略>
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character-set-server = utf8
default_password_lifetime = 0
<省略>

設定変更をしたので、mysqld を再起動

# systemctl restart mysqld.service

そして、再起動をしたらパスワード強度が元に戻っておった _no
初期値が MIDIUM らしいので、 /etc/my.cnf で初期設定しないと再起動の度に MIDIUM に戻るようで

# vi /etc/my.cnf
# cat /etc/my.cnf
<省略>
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
character-set-server = utf8
default_password_lifetime = 0
validate_password_policy=LOW
<省略>
# systemctl restart mysqld.service
# mysql -uroot -p
Enter password:
mysql> show variables like 'validate_password%';
+--------------------------------------+-------+
| Variable_name                        | Value |
+--------------------------------------+-------+
| validate_password_check_user_name    | OFF   |
| validate_password_dictionary_file    |       |
| validate_password_length             | 8     |
| validate_password_mixed_case_count   | 1     |
| validate_password_number_count       | 1     |
| validate_password_policy             | LOW   |
| validate_password_special_char_count | 1     |
+--------------------------------------+-------+
7 rows in set (0.00 sec)

よっしゃ!!!

mysql_secure_installation を実行する前に、 /etc/my.cnf に追記して再起動しておくのがいいな

(長いので分けました)

CentOS7で NIC名称を変更する

CentOS7になってから、NIC名称が ensXXX みたいになった

これはこれで良いんだけど、なんか数字がランダムすぎて良くわからん
ので、ethXの時代の手法にのっとって ens0 にでも変更する

1. /etc/default/grub に追記

GRUB_CMDLINE_LINUX="rd.lvm.lv=zabbix/root rd.lvm.lv=zabbix/swap rhgb quiet"

GRUB_CMDLINE_LINUX="rd.lvm.lv=zabbix/root rd.lvm.lv=zabbix/swap net.ifname=0 rhgb quiet"

に修正

2. grubのconfig反映

# grub2-mkconfig -o /boot/grub2/grub.cfg

3. /etc/sysconfig/network-scripts/ifcfg-ensXXX を修正

# mv /etc/sysconfig/network-scripts/ifcfg-ensXXX /etc/sysconfig/network-scripts/ifcfg-ens0
# vi /etc/sysconfig/network-scripts/ifcfg-ens0

DEVICE、NAMEを修正して
UUIDを削除して、HWADDR (Mac Address)に修正する

4. OS再起動

基本これでいったけど、ホントは色々あるっぽい