0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7/8 Red Hat7/8でよく必要となる設定(NW関連)

Last updated at Posted at 2019-11-15

1)ネットワーク設定
デバイスを確認
nmcli d

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

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

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

5)DNS設定
nmcli c modify eth0 ipv4.dns 192.168.10.1

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

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

8)設定確認
nmcli d show eth0

9)接続確認
ip addr

10)ネットワーク再起動
NetworkManagerをリスタート
systemctl restart NetworkManager

11)NetworkManagerからのResolveconf制御の解放

#/etc/NetworkManager/Networkmanager.conf
ーーーーーーーーーーーー
[main]

dns=none <ーを追加
ーーーーーーーーーーーー
※反映にはNetworkManagerリスタート

12)IPv6停止とルーティングON設定
#vi /etc/sysctl.d/99-custom.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv4.ip_forward = 1

13)設定の有効化
#sysctl -p /etc/sysctl.d/99-custom.conf
※iptableを使用する場合は上記が必要。Firewalldを使用する場合は自動的に有効化される

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?