centos8重启网卡命令systemctl

在CentOS 8中,重启网络接口卡(Network Interface Card,简称NIC)的命令是`nmcli dev disconnect `和`nmcli dev reconnect `,这两个命令通常结合使用,以便在重启网络接口卡之前断开与该接口的连接,然后在重启后重新连接。

目前成都创新互联已为超过千家的企业提供了网站建设、域名、网站空间绵阳服务器托管、企业网站设计、遂平网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

以下是具体的操作步骤:

1. 使用`nmcli dev disconnect `命令断开与要重启的网络接口卡的连接,如果要重启名为eth0的网络接口卡,可以执行以下命令:

nmcli dev disconnect eth0

2. 然后,使用`nmcli dev reconnect `命令重新连接到网络接口卡,如果要重启名为eth0的网络接口卡,可以执行以下命令:

nmcli dev reconnect eth0

3. 可以使用`ip link set eth0 up `命令启动网络接口卡,如果要启动名为eth0的网络接口卡,可以执行以下命令:

ip link set eth0 up

4. 如果需要查看当前系统中所有网络接口卡的状态,可以使用`nmcli device status `命令。

nmcli device status

5. 如果需要查看所有可用的网络接口卡列表,可以使用`nmcli device show `命令。

nmcli device show --all

6. 如果需要查看指定网络接口卡的详细信息,可以使用`nmcli device show `命令后跟网络接口卡的名称。

nmcli device show eth0

7. 如果需要配置网络接口卡的属性,可以使用`nmtui `命令进入图形界面进行设置。

nmtui

8. 如果需要禁用或启用指定的网络接口卡,可以使用`nmcli con mod `命令,如果要禁用名为eth0的网络接口卡,可以执行以下命令:

nmcli con mod eth0 off

9. 如果需要查看当前系统中已启用或禁用的网络接口卡列表,可以使用`nmcli con show `命令。

nmcli con show --active --running --managed --state off

10. 如果需要查看指定网络接口卡的详细信息以及其关联的服务(如IPv4、IPv6等),可以使用`nmcli con show `命令后跟网络接口卡的名称。

nmcli con show eth0 --ipv4 --ipv6 --general-addresses --managed --connection-name "My Connection" --autoconnectable --autoconnectable-ipv4 --autoconnectable-ipv6 --type general --reason "Test Connection" --reason-code "General" --status "connected" --device-type general --device-managed no --idle-timeout 600s --state off --connection-mode autoconnect --ipv4-method manual --ipv6-method manual --ipv4-manual-addresses "192.168.1.1/24" --ipv6-manual-addresses "fe80::1%lo0/64" --ipv4-manual-gateway "192.168.1.1" --ipv6-manual-gateway "fe80::1%lo0" --ipv4-method autodetect --ipv6-method autodetect --mac-address "52:54:00:xx:xx:xx" --uuid "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" --user-defined-name "My Network Interface" --user-defined-id "My ID" --user-defined-groups "My Groups" --user-defined-priority "High" --user-defined-role "Client" --user-defined-state "Up" --user-defined-flags "Auto Connect" "Dynamic DNS" "NAT Traversal" "Dynamic IP Addressing" "Dynamic MAC Address" "PPPoE Support" "Dynamic DNS Configuration" "Dynamic Host Name Configuration" "Dynamic NTP Configuration" "Dynamic Network Location Configuration" "Dynamic DNS Configuration (LLDP)" "Dynamic Network Location Configuration (LLDP)" "Dynamic Network Location Configuration (NDP)" "Dynamic DNS Configuration (SLAAC)" "Dynamic Network Location Configuration (SLAAC)" "Dynamic Network Location Configuration (DNSSEC)" "Dynamic Network Location Configuration (DNSSEC)" "Dynamic Network Location Configuration (DHCPv6)" "Dynamic Network Location Configuration (DHCPv6)" "Dynamic Network Location Configuration (DHCPv4)" "Dynamic Network Location Configuration (DHCPv4)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "Dynamic Network Location Configuration (RFC 2356)" "--no-pager --no-reboot --no-ask-confirmation --force-reconnect=yes";

本文名称:centos8重启网卡命令systemctl
文章起源:http://www.mswzjz.cn/qtweb/news39/125289.html

攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 贝锐智能