iproute2应用
linux目前都支持ip命令,与ifconfig类似,但ifconfig的软件net-tools早不更新了,ip功能更强大,推荐使用iproute2套件。

ip可以完美替换常用的网络命令,用法如下:
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
ip [ -force ] -batch filename
where OBJECT := { link | address | addrlabel | route | rule | neighbor | ntable |
tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |
netns | l2tp | fou | tcp_metrics | token | netconf }
OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |
-h[uman-readable] | -iec |
-f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |
-4 | -6 | -I | -D | -B | -0 |
-l[oops] { maximum-addr-flush-attempts } | -br[ief] |
-o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |
-rc[vbuf] [size] | -n[etns] name | -a[ll] |?-c[olor]}
常用命令如下:
ip link
ip addr show eth0
ip addr add 192.168.0.100/24 dev eth0
ip addr del 192.168.0.100/24 dev eth0
ip route show
ip route get 10.42.0.47 ;获取ip地址的路由包从哪里来
ip route add default via 192.168.0.100
ip neighbour ;显示ARP MAC地址
ip link set ppp0 down ;断开连接,相当于ifconfig ppp0 down
ip link set ppp0 up ;连接,相当于ifconfig ppp0 up
ip route help
注意IP地址要有一个后缀,比如/24。这种用法用于在无类域内路由选择(CIDR)中来显示所用的子网掩码。
参考:
https://linux.cn/article-3144-1.html
iproute2应用的更多相关文章
- Network - 对比net-tools与iproute2
net-tools VS iproute2 net-tools与iproute2大比较
- [转] Linux TCP/IP网络小课堂:net-tools与iproute2大比较
PS:netstat选项是-planet,方便记忆 http://os.51cto.com/art/201409/450886.htm 如今许多系统管理员仍结合使用ifconfig.route.arp ...
- Linux网络管理常用命令:net-tools VS iproute2
Exported from workflowy! net-tools ifconfigifconfig命令:用于接口及地址查看和管理 route netstat arp iproute2 ip lin ...
- net-tools与iproute2
net-tools与iproute2 我们知道redhat系列发行版7x版本中最小化安装是没有net-tools工具包的,默认使用iproute2工具包,最直观的感受是ifconfig命令被ip命令所 ...
- iproute2学习笔记
一.替代arp, ifconfig, route等命令 显示网卡和IP地址 root@openstack:~# ip link list 1: lo: <LOOPBACK,UP,LOWER_UP ...
- iproute2 与 net-tools
https://linux.cn/article-4326-1.html https://blog.csdn.net/astrotycoon/article/details/52317288 如今很多 ...
- iproute2 对决 net-tools
如今很多系统管理员依然通过组合使用诸如ifconfig.route.arp和netstat等命令行工具(统称为net-tools)来配置网络功能,解决网络故障.net-tools起源于BSD的TCP/ ...
- linux网络工具iproute2的使用简介
一.写本文的目的 本文完全是自己在学习iproute2的过程中搜集的大杂烩,记录在这里,方便以后自己查询学习,图片都是来自网络,在此表示感谢! 二.简单了解iproute2工具套装 iproute2是 ...
- SS iproute2,nslookup,dig
从某种意义上说,iproute工具集几乎可以替代掉net-tools工具集,具体的替代方案是这样的:用途 net-tool(被淘汰) iproute2地址和链路配置 ifconfig ip ...
随机推荐
- 关于Random.Range 范围界定
1. 当Range的参数是float时 Random.Range 范围 static function Range (min : float, max : float) : float :返回一个随机 ...
- spring boot + embed tomcat + standalone jar的内存泄露问题
前一阵遇到了一个很坑的内存泄露问题,记录于此: 有个项目采用spring cloud重构后,部署到线上(其中有一个接口,大概每天调用量在1千万次左右),发现zabbix监控里,linux的可用内存一直 ...
- Linux:FHS标准
FHS(英文:Filesystem Hierarchy Standard 中文:文件系统层次结构标准),多数Linux版本采用这种文件组织形式,FHS定义了系统中每个区域的用途.所需要的最小构成的文件 ...
- Asp.Net Core 自定义设置Http缓存处理
一.使用中间件 拦截请求自定义输出文件 输出前自定义指定响应头 public class OuterImgMiddleware { public static string RootPath { ge ...
- .Net Core邮件发送之MailKit
一 .在.Net Core中MailKit中提供了邮件的基础封装 它支持跨平台,并且支持 IMAP, POP3, SMTP 等协议 Nuget命令: Install-Package MailKit 官 ...
- HTML5 Selection对象
一.实例1,设置网页选中内容并且复制到黏贴板 <p id='txtone'>发的FDSAFSDFDS!其实不管哪个行业, <img src='http://beijing.gongj ...
- JSON数据之使用Fastjson进行解析(一)
据说FastJson是目前最快的解析Json数据的库,而且是国人开发出来的开源库.顶一下,付上官方网址:http://code.alibabatech.com/wiki/pages/viewpage. ...
- PHP的unset究竟会不会释放内存?
首先让我们看一个例子 var_dump(memory_get_usage()); $a = "laruence"; var_dump(memory_get_usage( ...
- linux设置预留端口号,防止监听端口被占用 ip_local_reserved_ports
1. 背景 linux服务器启动时,会对指定的端口进行监听bind,如果同一个机器上这个端口已经被使用,则监听失败,程序无法启动. linux客户端连接服务器accept时,系统会分配本地临时端口用于 ...
- python data analysis | python数据预处理(基于scikit-learn模块)
原文:http://www.jianshu.com/p/94516a58314d Dataset transformations| 数据转换 Combining estimators|组合学习器 Fe ...