ifconfig命令输出无结果
ifconfig 命令用来查看和配置网络设备。 当网络环境发生改变时可通过此命令对网络进行相应的配置。 up 启动指定网络设备/网卡。 down 关闭指定网络设备/网卡。 该参数可以有效地阻止通过指定接口的IP信息流,如果想永久地关闭一个接口,我们还需要从核心路由表中将该接口的路由信息全部删除。
image-20230401173313541
可查看到/sbin不在系统环境变量中,将/sbin加入环境变量。
[root@k8s-master network-scripts]# export PATH=$PATH:/sbin
查看文件/sbin/ifconfig
这里缺少ifconfig文件,然后从局域网另一台机器上使用 scp 命令 copy 了一份 /sbin/ifconfig 到这台机器上
[root@master ~]# scp /sbin/ifconfig root@192.168.248.138:/sbin
The authenticity of host '192.168.248.138 (192.168.248.138)' can't be established.
ECDSA key fingerprint is SHA256:UyF/byZet48SDuNxrHmr5bsiyM7d9sbaUHWiRxpFxmA.
ECDSA key fingerprint is MD5:94:35:a0:1d:45:74:89:65:17:97:39:b2:f3:3d:c9:08.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.248.138' (ECDSA) to the list of known hosts.
root@192.168.248.138's password:
ifconfig 100% 80KB 31.5MB/s 00:00
然后查看
[root@k8s-master network-scripts]# file /sbin/ifconfig
/sbin/ifconfig: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=22d5b3be8d3ce3c71cad5b982581ede262397b56, stripped
再次使用ifconfig命令