Centos 7では、標準ではifconfig は利用できない。†
廃止される予定だが、新しいコマンドには慣れない場合は、"net-tools" パッケージを入れれば利用できる。
どうしても慣れないので、インストール
yum install net-toolsコマンドを実行
出力例†
[root@## ~]# yum install net-tools
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.tsukuba.wide.ad.jp
* extras: ftp.tsukuba.wide.ad.jp
* updates: ftp.tsukuba.wide.ad.jp
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ net-tools.x86_64 0:2.0-0.17.20131004git.el7 を インストール
--> 依存性解決を終了しました。
依存性を解決しました
==========================================================================================================================================================================================================
Package アーキテクチャー バージョン リポジトリー 容量
==========================================================================================================================================================================================================
インストール中:
net-tools x86_64 2.0-0.17.20131004git.el7 base 304 k
トランザクションの要約
==========================================================================================================================================================================================================
インストール 1 パッケージ
総ダウンロード容量: 304 k
インストール容量: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.17.20131004git.el7.x86_64.rpm | 304 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
インストール中 : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
検証中 : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
インストール:
net-tools.x86_64 0:2.0-0.17.20131004git.el7
完了しました!
[root@## ~]# ifconfig
eno16777736: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.11.23 netmask 255.255.255.0 broadcast 192.168.11.255
inet6 fe80::20c:29ff:fe54:487c prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:54:48:7c txqueuelen 1000 (Ethernet)
RX packets 15915 bytes 17501578 (16.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5401 bytes 1309171 (1.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 40 bytes 3950 (3.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40 bytes 3950 (3.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@## ~]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1713/master
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1245/sshd
tcp 0 96 192.168.11.23:22 192.168.11.14:50803 ESTABLISHED 2395/sshd: root@pts
tcp 0 0 192.168.11.23:54027 203.178.132.80:80 TIME_WAIT -
tcp6 0 0 ::1:25 :::* LISTEN 1713/master
tcp6 0 0 :::443 :::* LISTEN 2861/httpd
tcp6 0 0 :::80 :::* LISTEN 2861/httpd
tcp6 0 0 :::22 :::* LISTEN 1245/sshd
