码迷,mamicode.com
首页 > 其他好文 > 详细

IP命令总结

时间:2018-08-31 12:34:28      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:rss   rust   batch   ons   ble   moni   prot   ica   mon   

如果设定固定的IP地址,那么在/etc/sysconfig/network-scripts/ifcfg-XXX以及/etc/resolv.conf中即可。

这里是学习ip命令的总结:

# ip --help
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
    ip [ -force ] -batch filename
where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable | tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm | netns | l2tp | macsec | tcp_metrics | token }
   OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] | -h[uman-readable] | -iec | -f[amily] { inet | inet6 | ipx | dnet | bridge | link } | -4 | -6 | -I | -D | -B | -0 | -l[oops] { maximum-addr-flush-attempts } | -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] | -rc[vbuf] [size] | -n[etns] name | -a[ll] }

用到的比较多的主要就是ip link | ip addr | ip route 其他的用到再更新

1、ip link :主要用于修改网络设备的配置信息,包括修改MAC地址,名称


# ip link help
Usage: ip link add [link DEV] [ name ] NAME
         [ txqueuelen PACKETS ]
         [ address LLADDR ]
         [ broadcast LLADDR ]
         [ mtu MTU ]
         [ numtxqueues QUEUE_COUNT ]
         [ numrxqueues QUEUE_COUNT ]
         type TYPE [ ARGS ]
ip link delete { DEVICE | dev DEVICE | group DEVGROUP } type TYPE [ ARGS ]

ip link set { DEVICE | dev DEVICE | group DEVGROUP }

      [ { up | down } ]
      [ type TYPE ARGS ]
      [ arp { on | off } ]
      [ dynamic { on | off } ]
      [ multicast { on | off } ]
      [ allmulticast { on | off } ]
      [ promisc { on | off } ]
      [ trailers { on | off } ]
      [ txqueuelen PACKETS ]
      [ name NEWNAME ]
      [ address LLADDR ]
      [ broadcast LLADDR ]
      [ mtu MTU ]
      [ netns { PID | NAME } ]
      [ link-netnsid ID ]
      [ alias NAME ]
      [ vf NUM [ mac LLADDR ]
      [ vlan VLANID [ qos VLAN-QOS ] ]
      [ rate TXRATE ]
      [ max_tx_rate TXRATE ]
      [ min_tx_rate TXRATE ]
      [ spoofchk { on | off} ]
      [ query_rss { on | off} ]
      [ state { auto | enable | disable} ] ]
      [ trust { on | off} ] ]
      [ master DEVICE ]
      [ nomaster ]
      [ addrgenmode { eui64 | none } ]
      [ protodown { on | off } ]
ip link show [ DEVICE | group GROUP ] [up] [master DEV] [type TYPE]
ip link help [ TYPE ]


TYPE := { vlan | veth | vcan | dummy | ifb | macvlan | macvtap | bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan | gre | gretap | ip6gre | ip6gretap | vti | nlmon | bond_slave | geneve | bridge_slave | macsec }


# ip link show : 查看端口的具体信息

# ip link add eth1 name Test type bridge :创建一个名字是Test的类型是bridge的eth1端口

 

 

IP命令总结

标签:rss   rust   batch   ons   ble   moni   prot   ica   mon   

原文地址:https://www.cnblogs.com/teezzy/p/9565122.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!