在Rancher中运行一个Ubuntu服务(容器),在该容器中执行命令行,运行查看IP地址命令时报错。这是怎么回事?怎么解决?
ip命令在iproute2软件包中,ifconfig命令在net-tools软件包中。使用APT命令安装iproute2、ifconfig软件包即可。
#如果要执行ip命令,
#需要安装iproute2软件包:
apt update
apt install iproute2
#查看IP地址:
ip a
#如果要执行ifconfig命令,
#需要安装net-tools工具包
apt update
apt install net-tools
#查看IP地址:
ifconfig



