Docker 构建 CentOS 7.8.2003 安装ifco
2020-06-12 本文已影响0人
孙瑞锴
1. 借鉴
2. 开始
缘起
- 直接运行ifconfig
ifconfig
- 提示没有这个命令
bash: ifconfig: command not found
- 没有那我们安装一下吧yum install ifconfig
yum install ifconfig
- 又提示没有包-_-
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.bfsu.edu.cn
* updates: mirror.bit.edu.cn
No package ifconfig available.
Error: Nothing to do
- 好的吧,通过search命令来搜索一下
yum search ifconfig
- 终于好像有一个匹配的了[net-tools.x86_64]
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.bfsu.edu.cn
* updates: mirror.bit.edu.cn
================================================== Matched: ifconfig ============================================
net-tools.x86_64 : Basic networking tools
解决
- 安装一下net-tools.x86_64
yum install net-tools.x86_64
- 再次执行ifconfig
ifconfig
- 发现可以了_
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.2 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:ac:11:00:02 txqueuelen 0 (Ethernet)
RX packets 18553 bytes 26721726 (25.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8741 bytes 479526 (468.2 KiB)
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
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0