Linux iproute2 命令家族(ip / ss)

iproute 简介

iproute 与 内核是密切相关的,所以两者版本是一致的。

[root@LeeMumu ~]# rpm -qi iproute
Name        : iproute
Version     : 4.11.0
Release     : 14.el7_6.2
Architecture: x86_64
Install Date: Sun 28 Jul 2019 09:28:29 AM EDT
Group       : Applications/System
Size        : 1793061
License     : GPLv2+ and Public Domain
Signature   : RSA/SHA256, Mon 29 Apr 2019 11:45:09 AM EDT, Key ID 24c6a8a7f4a80eb5
Source RPM  : iproute-4.11.0-14.el7_6.2.src.rpm
Build Date  : Wed 24 Apr 2019 10:03:34 AM EDT
Build Host  : x86-02.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://kernel.org/pub/linux/utils/net/iproute2/
Summary     : Advanced IP routing and network device configuration tools
Description :
The iproute package contains networking utilities (ip and rtmon, for example)
which are designed to use the advanced networking capabilities of the Linux
kernel.
[root@LeeMumu ~]# uname -r
3.10.0-957.el7.x86_64
[root@LeeMumu ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 

ip 命令

用来显示或操纵Linux主机的路由、网络设备、策略路由和隧道,是Linux下较新的功能强大的网络配置工具。

show / manipulate routing, devices, policy routing and tunnels

语法格式:

# ip [ OPTIONS ] OBJECT {
    COMMAND | help }
				 OBJECT := {
    link | addr | route | netns  }

注意: OBJECT可简写,各OBJECT的子命令也可简写

1、ip link

ip link: network device configuration

1.1 up / down 和 multicast

ip  link  set - change device attributes
	dev NAME (default)            # 指明要管理的设备,dev 关键字可省略
	up 和 down                    # 对接口进行up或down
	multicast on 或 multicast off # 启用或禁用多播功能
	
# ip link set tangtang multicast on

1.2 name

# ip  link  set name NAME:重命名接口
	# 重命名接口时,需要对接口进行down,才能进行操作
	
# ip link set wlp2s0 name tangtang
RTNETLINK answers: Device or resource busy
# ip link set wlp2s0 down
# ip link set wlp2s0 name tangtang
# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
	link/loopback 00:00:
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值