Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
200
Help us understand the problem. What is going on with this article?
@taro0219

centos7 ネットワーク設定

More than 3 years have passed since last update.

centos7 ネットワーク設定

デバイスを確認
nmcli d

インターフェイスを有効化
nmcli c m eth0 connection.autoconnect yes

IPアドレス、サブネットマスクを変更
nmcli c modify eth0 ipv4.addresses 172.16.0.100/24
※デバイスを確認して「eth0」を変更する

デフォルトゲートウェイを設定
nmcli c modify eth0 ipv4.gateway 172.16.0.1

DNS設定
nmcli c modify eth0 ipv4.dns 172.16.0.1

IPを固定割り当てに設定 (DHCP は "auto"に変更)
nmcli c modify eth0 ipv4.method manual

インターフェースを再起動して設定を反映
nmcli c down eth0; nmcli c up eth0
※デバイスを確認して「eth0」を変更する

設定確認
nmcli d show eth0

接続確認
ip addr

ネットワーク再起動
systemctl restart network

ファイル確認
less /etc/sysconfig/network-scripts/ifcfg-eth0
※ifcfg-eth0はデバイスで確認する。

200
Help us understand the problem. What is going on with this article?
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

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
200
Help us understand the problem. What is going on with this article?