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 ...
随机推荐
- STL之双向队列(dequeue)
//双向队列 deque #include <deque> #include <cstdio> #include <algorithm> using namespa ...
- Playmaker全面实践教程之简单的使用Playmaker示例
Playmaker全面实践教程之简单的使用Playmaker示例 简单的使用Playmaker示例 通过本章前面部分的学习,相信读者已经对Playmaker有了一个整体的认识和印象了.在本章的最后,我 ...
- 不在框架中,利用Django的models操作
import os import sys import django sys.path.apprnd(r'路径') os.chdir(r'路径') os.environ.setdefault('DJA ...
- VC++ 使用attributes定义接口
1.定义预处理命令_ATL_ATTRIBUTES 2.在一个全局的Cpp文件里面配置module的attribute [module(dll, uuid = "{3845951F-15B ...
- C# 获取文件名及扩展名【转】
https://www.cnblogs.com/libushuang/p/5794976.html C# 获取文件名及扩展名 string aFirstName = aFile.Substring(a ...
- STM32 F103 F407 F429 F767对比图
- Mentor面向智能家居的IoT方案
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/wireless_com/article/details/82111734 眼下有各种智能家居的自己主 ...
- array2json() - Convert PHP arrays to JSON
array2json is a PHP function that will convert the array given as its argument into a JSON string. T ...
- GDAL对TIF创建内建金字塔一个问题
gdalwarp输出tif图像的时候,默认如果没有使用BIGTIFF=YES选项,则会根据输出影像的大小进行判断,低于4G则不适用bigtiff格式. 对于非bigtiff图像,如果这时候使用gdal ...
- linux使用pam_tally2.so模块限制登录3次失败后禁止5分钟
在线上的服务器有时需要限制用户登录次数.这个功能可以通过pam的pam_tally2.so模块来实现 PAM模块是用sun提出的一种认证机制 pam_tally2.so模块 一.格式 pam_tall ...