使用linux中usernetctl命令操作指定的网络接口

这篇文章将为大家详细讲解有关使用linux中usernetctl命令操作指定的网络接口,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。

usernetctl命令在用于被允许时操作指定的网络接口。在使用上和”ifup”、”ifon”命令有些类似。

语法格式:usernetctl [参数]  [网络接口]

常用参数:

up 激活网络接口
down 禁用网络接口
report 报告网络接口

参考实例

激活网络接口:

[root@linuxcool ~]# usernetctl enp1s0 up

禁用网络接口:

[root@linuxcool ~]# usernetctl enp1s0 down

报告网络接口状态:

[root@linuxcool ~]# usernetctl enp1s0 report

关于使用linux中usernetctl命令操作指定的网络接口就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。