Linux command: ip command

ip Command functions: Configure network properties

 

A, ip link Series

  ip link

    ip [-s] Link Show        # view the default information

      ip link show eth0

      ip link show up

    Link Show up ip         # View enabled port

    Link Show LO ip         # view a port

    ip link set Interface [up | Down] [multicast ON | OFF]:    # turn on or off Interface

      ip link set [dev] eth0 up

 

Two, ip address series (may be abbreviated as ip addr, or ip a)

  ip address  

    ip addr show

    ip addr add dev adapter ip address / mask [ladel alias]

    ip addr del dev interfaces ip address [ladel alias]

    ip addr flush dev Interface [ladel alias] #  Empty interface address configuration information, remove all ip addresses

举例
# ip addr add dev eth0 192.168.100.21/24 label eth0:0  
# ip addr del dev eno16777736 192.168.100.21/24       

 

Three, ip route Series

  ip route

    ip route show

    route the Add XXXX IP / 24 Via   Gateway Address [dev Interface]

    ip route del x.x.x.x/24

    ip route flush [dev Interface] [Via the PREFIX]       # Clear all routing entries in the routing table, caution   

Example 
# IP route the Add 172.16 . 0.0 / 24 Via 192.168 . 100.1 
# IP route del 172.16 . 0.0 / 24 
# dev eth0 IP route the flush
# default IP route Via 172.16.0.1 # adding gateways, i.e. default route

 

Guess you like

Origin www.cnblogs.com/ysuwangqiang/p/11527619.html