如何在 RHEL 8/CentOS 8 Linux 上安装 Ifconfig

您所在的位置:网站首页 centos安装iwconfig 如何在 RHEL 8/CentOS 8 Linux 上安装 Ifconfig

如何在 RHEL 8/CentOS 8 Linux 上安装 Ifconfig

2024-07-06 05:31| 来源: 网络整理| 查看: 265

如何在 RHEL 8/CentOS 8 Linux 上安装 Ifconfig

您在 RHEL 8/CentOS 8 最小服务器安装中是否收到'Ifconfig' Command Not Found? RHEL 8/CentOS 8 的最小安装不附带 ifconfig 命令。查看 RHEL 8 新功能

ifconfig 是一个命令行工具,用于配置驻留在内核的网络接口。使用 ifconfig,您可以配置网络接口,显示当前可用的所有接口(即使已关闭)。

注意:ifconfig 程序已过时!如需替换,请检查 ip addr 和 ip link 命令。

在 RHEL 8/CentOS 8 的最小安装中,ifconfig 命令由包 net-tools 提供,它是基本网络管理工具组包。

$ sudo yum provides ifconfig Updating Subscription Management repositories. Updating Subscription Management repositories. Last metadata expiration check: 21 days, 0:07:56 ago on Fri 30 Nov 2018 03:57:18 AM EST. net-tools-2.0-0.51.20160912git.el8.x86_64 : Basic networking tools Repo : @System Matched from: Filename : /usr/sbin/ifconfig net-tools-2.0-0.51.20160912git.el8.x86_64 : Basic networking tools Repo : rhel-8-for-x86_64-baseos-beta-rpms Matched from: Filename : /usr/sbin/ifconfig在 RHEL 8/CentOS 8 上安装 ifconfig

要获取 ifconfig 命令,请安装 net-tools 包:

sudo yum -y install net-toolsIfconfig 用法备忘单

1. 显示第一个以太网适配器的网络设置

$ ifconfig wlan0 $ ifconfig eth0

2. 显示所有界面,即使已关闭:

$ ifconfig -a

3. 取下/打开网络适配器:

$ ifconfig wlan0/eth0 {up|down}

4. 设置静态 IP 和网络掩码:

$ ifconfig eth0 192.168.1.100 netmask 255.255.255.0

5. 您可能还需要添加网关 IP

$ route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1

6. 更改 MAC 地址

$ ifconfig eth0 hw ether AA:BB:CC:DD:EE:FF

7. 启用混杂模式

ifconfig eth0 promisc ifconfig eth0 -promisc

8. 向网络接口添加新别名

ifconfig eth0:0 172.16.25.127 ifconfig eth0:0 down

现在,您的 RHEL 8/CentOS 8 服务器上已经有了 ifconfig。

有关 CentOS 8 的更多信息:

在 CentOS 8/RHEL 8 上启用 PowerTools 存储库

在 CentOS 8 上安装 Puppet 6.x Master/Server | RHEL 8

使用 Postfix、Dovecot、MySQL 和 RoundCube 在 CentOS 8 上设置邮件服务器



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3