LoginSignup
28
36

More than 5 years have passed since last update.

[Linux] ネットワーク・インターフェースの有効化/無効化

Posted at

eth0等のネットワーク・インターフェースの有効/無効の切替方法メモ

旧来の方法 (ifconfig, ifdown, ifup)

ifconfigか、ifdown, ifup という専用コマンドをつかえばよい

ネットワークインターフェースの無効化
$ ifconfig eth0 down
or
$ ifdown eth0
ネットワークインターフェースの有効化
$ ifconfig eth0 up
or
$ ifup eth0

今後の推奨だろうコマンド (ip, nmcli)

net-tools系のコマンドはどうも非推奨になっているらしい。iproute2 パッケージ内のコマンドだと以下のようにする。

ipの場合
$ ip l set eth0 up
$ ip l set eth0 down
nmcliの場合
$ nmcli c down eth0
$ nmcli c up eth0

参考
RHEL7/CentOS7でipコマンドをマスター - めもめも

参考

Linuxコマンド集 - 【ifdown】ネットワーク・インターフェースを無効にする:ITpro
Linuxコマンド集 - 【ifup】ネットワーク・インターフェースを有効にする:ITpro
ネットワーク管理の基本Tips:NICの無効化/有効化、再起動を行うには? ifdown/ifupコマンド - @IT
RHEL/CentOSでネットワークインタフェースの起動が遅い原因を調べてみた - Dマイナー志向

28
36
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
28
36