使用 Hyper-V 成功安装 openSUSE-Leap-15.4 系统后,发现没有 ifconfig 指令。这是因为,SUSE 默认不支持 ifconfig 指令,需要我们手动安装。安装过程如下:
首次安装完 SUSE 后,默认的数据源是 openSUSE,国内访问存在问题,需要将软件源替换成国内源,执行如下命令:
// 禁用 openSUSE 默认的软件源 sudo zypper mr -da // 安装国内软件源 sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/distribution/leap/15.2/repo/oss openSUSE15.2-Aliyun-OSS sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/distribution/leap/15.2/repo/non-oss openSUSE15.2-Aliyun-NON-OSS sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/update/leap/15.2/oss openSUSE15.2-Aliyun-UPDATE-OSS sudo zypper ar -fc https://mirrors.aliyun.com/opensuse/update/leap/15.2/non-oss openSUSE15.2-Aliyun-UPDATE-NON-OSS // 刷新 sudo zypper ref
点击 https://www.hxstrive.com/article/916.htm 查看详细教程。
执行 zypper search net-tools 命令搜索 net-tools 软件包。命令如下:
hxstrive@localhost:~> zypper search net-tools Loading repository data... Warning: Repository 'openSUSE-15.2-Update-Non-Oss' appears to be outdated. Consider using a different mirror or server. Warning: Repository 'openSUSE-15.2-Update-Oss' appears to be outdated. Consider using a different mirror or server. Reading installed packages... S | Name | Summary | Type ---+----------------------+------------------------------------+-------- i+ | net-tools | Important Programs for Networking | package i+ | net-tools-deprecated | Deprecated Networking Utilities | package | net-tools-lang | Translations for package net-tools | package
根据搜索的结果,我们使用 zypper 安装 net-tools-deprecated 软件包。命令如下:
hxstrive@localhost:~> sudo zypper install net-tools-deprecated [sudo] password for root: Loading repository data... Warning: Repository 'openSUSE-15.2-Update-Non-Oss' appears to be outdated. Consider using a different mirror or server. Warning: Repository 'openSUSE-15.2-Update-Oss' appears to be outdated. Consider using a different mirror or server. Reading installed packages... Resolving package dependencies... The following NEW package is going to be installed: net-tools-deprecated 1 new package to install. Overall download size: 167.5 KiB. Already cached: 0 B. After the operation, additional 460.1 KiB will be used. Continue? [y/n/v/...? shows all options] (y): y Retrieving package net-tools-deprecated-2.0+git20170221.479bb4a-lp152.5.5.x86_64 (1/1), 167.5 KiB (460.1 KiB unpacked) Retrieving: net-tools-deprecated-2.0+git20170221.479bb4a-lp152.5.5.x86_64.rpm .......................[done (67.2 KiB/s)] Checking for file conflicts: .....................................................................................[done] (1/1) Installing: net-tools-deprecated-2.0+git20170221.479bb4a-lp152.5.5.x86_64 ..................................[done]
使用 ipconfig 命令查看本机IP信息,命令如下:
hxstrive@localhost:~> ifconfig ... lo: flags=73<UP,LOOPBACK,RUNNING> mtu 1500 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0xfe<compat,link,site,host> loop (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