3

Linux 启用/打开网卡/接口

 1 year ago
source link: https://www.myfreax.com/linux-enable-open-network-card-interface/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
ip

Linux 启用/打开网卡/接口

ip命令是每个Linux系统管理员熟知的网络接口配置的超级工具

Updated At 10 Dec 2022 2 min read
By myfreax
Linux 启用/打开网卡/接口

Linux 启用/打开网卡/接口

ip命令是每个Linux系统管理员熟知的网络接口配置的超级工具。它可用于接口关闭与开启,分配和删除ip地址以及ARP路由缓存管理等等。

ip命令已安装在所有现代Linux发行版,它是iproute2软件的一部分。这里的网络接口也就是我们常说的网卡。

ip命令的语法是ip [ OPTIONS ] OBJECT { COMMAND | help }OBJECT是您要管理的对象类型。最常用的对象是。link/l显示和修改网络接口信息。

对象可以以完整或缩写形式书写。ip OBJECT help命令打印每个对象子命令和参数列表。

在配置网络接口时,必须以root用户或具有sudo权限用户运行命令,否则将打印消息RTNETLINK answers: Operation not permitted

使用ip命令设置的配置不是永久的。系统重启后,所有更改都将丢失。对于永久设置,您需要编辑特定于发行版的配置文件或将命令添加到启动脚本。

对网络接口常用的操作是启用或关闭接口,在远程服务器操作时你应该小心使用此操作。

启用或者关闭接口的命令形式是ip link set dev {DEVICE} {up|down}{DEVICE}是接口的名称。{up|down}设置接口的状态。

命令ip link set eth0 up启用eth0接口,如果需要关闭,请运行命令ip link set eth0 down

ip link set eth0 up
ip link set eth0 down

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK