在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";
原创文章,作者:未希,如若转载,请注明出处:https://www.kdun.com/ask/38355.html
本网站发布或转载的文章及图片均来自网络,其原创性以及文中表达的观点和判断不代表本网站。如有问题,请联系客服处理。
发表回复