LoginSignup
0
0

More than 5 years have passed since last update.

[とあるコンテスト: IPv4 address] ipコマンドを使って、IPv4 Address を設定

Posted at

Hello world !!
今回は、ifconfigコマンドに代わるipコマンドでIPv4アドレスを設定していきます。
簡単な備忘録なので、詳細はman ip (あるいは、man ip-address) コマンドで見てください。

環境

  • CentOS 7.4 (on VirtualBox)

設定

設定内容は、ipv4アドレス=192.168.0.1/24ネットワークデバイス名=enp0s3とします。

# ip address add 192.168.0.1/24 dev enp0s3

ip address は、ip a に省略可能です。
ちなみに、IPv6 address を設定したい場合は、アドレスの部分をIPv6にすれば設定できます。

設定内容の確認は、

$ ip a

あるいは、

$ ip a sh enp0s3

設定したアドレスを削除したい場合は

# ip a delete 192.168.0.1/24 dev enp0s3

と、コマンドを打ちます。

楽勝ですね♪

0
0
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
0