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应用的更多相关文章

  1. Network - 对比net-tools与iproute2

    net-tools VS iproute2 net-tools与iproute2大比较

  2. [转] Linux TCP/IP网络小课堂:net-tools与iproute2大比较

    PS:netstat选项是-planet,方便记忆 http://os.51cto.com/art/201409/450886.htm 如今许多系统管理员仍结合使用ifconfig.route.arp ...

  3. Linux网络管理常用命令:net-tools VS iproute2

    Exported from workflowy! net-tools ifconfigifconfig命令:用于接口及地址查看和管理 route netstat arp iproute2 ip lin ...

  4. net-tools与iproute2

    net-tools与iproute2 我们知道redhat系列发行版7x版本中最小化安装是没有net-tools工具包的,默认使用iproute2工具包,最直观的感受是ifconfig命令被ip命令所 ...

  5. iproute2学习笔记

    一.替代arp, ifconfig, route等命令 显示网卡和IP地址 root@openstack:~# ip link list 1: lo: <LOOPBACK,UP,LOWER_UP ...

  6. iproute2 与 net-tools

    https://linux.cn/article-4326-1.html https://blog.csdn.net/astrotycoon/article/details/52317288 如今很多 ...

  7. iproute2 对决 net-tools

    如今很多系统管理员依然通过组合使用诸如ifconfig.route.arp和netstat等命令行工具(统称为net-tools)来配置网络功能,解决网络故障.net-tools起源于BSD的TCP/ ...

  8. linux网络工具iproute2的使用简介

    一.写本文的目的 本文完全是自己在学习iproute2的过程中搜集的大杂烩,记录在这里,方便以后自己查询学习,图片都是来自网络,在此表示感谢! 二.简单了解iproute2工具套装 iproute2是 ...

  9. SS iproute2,nslookup,dig

    从某种意义上说,iproute工具集几乎可以替代掉net-tools工具集,具体的替代方案是这样的:用途  net-tool(被淘汰)   iproute2地址和链路配置   ifconfig  ip ...

随机推荐

  1. shell 环境变量

    Ubuntu系统设置的环境变量 .profile .bashrc 在 .profile中 有一段代码: if [ -d "$HOME/bin" ] ; then PATH=&quo ...

  2. internet连接共享

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_shai nternet连接共享 允许其他网络用户通过此计算机的internet连接来连接

  3. [NOIp2015提高组]跳石头

    OJ题号:洛谷2678 思路:贪心+二分. 从前往后扫,一旦这个石头到上一个选的石头的距离小于二分的值就把这块石头移走. #include<cstdio> #include<queu ...

  4. java给时间格式化

    package com.apress.springrecipes.sequence; import java.text.DateFormat;import java.text.SimpleDateFo ...

  5. centos7安装单机rocketmq,图文教程

    系统环境 1.操作系统:64位CentOS Linux release 7.2.1511 (Core) 2.jdk版本:1.8.0_121 3.IP地址:192.168.1.210 下载rocketm ...

  6. pkg-config命令的Makefile.am

    举例:通过Makefile调用pkg-config命令. pkg-config - Return metainformation about installed libraries (为了使用lib库 ...

  7. 440P 测试三星ssd840pro 512g

    下面是鲁大师的截屏 安装win8.1 x64颇费周折,计算机->管理模糊,解决方法 现在最大的问题是cpu风扇噪音和温度,看网上确实存在此问题,纯铜风扇+7783硅脂是必须的,下面鲁大师温度截屏 ...

  8. (转)Unity3D - 动作动画忽略timeScale

    转自:http://blog.csdn.net/ynnmnm/article/details/46866347 最近在调战斗时的动画与特效,Unity3D对加/减速提供了Time.timeScale支 ...

  9. password、文件MD5加密,passwordsha256、sha384、sha512Hex等加密

    package encryption; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io. ...

  10. 利用Xmanager Enterprise 5的passive显示远程linux主机图形化信息

    问题描述: 最初的需求是,安装oracle数据(第一次安装都是图形化linxu进去一步步操作,后续发现可以命令静默安装不调用图形化,学习就是步步入深,方得始终),最初实现window弹出linux主机 ...