Thursday, April 18, 2013

ip tools note

ifconfig 和一些 tools 已經要漸漸被拿掉了

整理一些用法

old         ->  new
=====================================
arp         ->  ip n (ip neighbor)
ifconfig    ->  ip l (ip link)
                ip a (link addr)

iptunne     ->  ip tunnel
iwconfig    ->  iw
netstat     ->  ss
                ip route (for netstat-r)
                ip -s link (for netstat -i)
                ip maddr (for netstat-g) (multicast address)

route       ->  ip r (ip route)


ip link                                             # <if>: interface something like 'enp2s0'
ip link set <if> up                                 # switch <if>
ip link set <if> down
ip link show dev <if>                               # show <if>
ip link set dev <if> mtu 1400                       # set mtu
ip link add link eth0 name eth0.10 type vlan id 10  # create vlan
ip link delete dev eth0.10                          # delete vlan

ip addr add <ip address>/<subnetmask> dev <if>      # add address
ip addr del <ip address>/<subnetmask> dev <if>      # delete address
ip addr show dev <if>                               # show address
ip addr flush dev <if>                              # removes all addresses from device <if>

ip route add default via <gateway's ip address>     # add a routing path
ip route add - add new route
ip route change - change route
ip route replace - change or add new one


ref.

wiki.archlinux.org Network Configuration
wiki.archlinux.org VLAN

No comments:

Post a Comment