# iproute2 (ip) Befehle

<p class="callout success">Die wichtigsten iproute2 (ip) Befehle</p>

##### Show informations

<table border="1" id="bkmrk-show-link-status%C2%A0-ip" style="border-collapse: collapse; width: 100%; height: 202.467px;"><colgroup><col style="width: 24.9101%;"></col><col style="width: 47.2034%;"></col><col style="width: 27.8845%;"></col></colgroup><tbody><tr style="height: 30.8px;"><td style="height: 30.8px;">Show link status

</td><td style="height: 30.8px;">***ip link show***</td><td style="height: 30.8px;">***ip l***</td></tr><tr style="height: 35.6px;"><td style="height: 35.6px;">Show link status &amp; stats

</td><td style="height: 35.6px;">***ip -statistics link show*** </td><td style="height: 35.6px;">***ip -s l***</td></tr><tr style="height: 36.2667px;"><td style="height: 36.2667px;">Show IP address

</td><td style="height: 36.2667px;">***ip addr show***</td><td style="height: 36.2667px;">***ip a***

</td></tr><tr style="height: 32.2667px;"><td style="height: 32.2667px;">Show ARP cache

</td><td style="height: 32.2667px;">***ip neigh show***

</td><td style="height: 32.2667px;">***ip n***

</td></tr><tr style="height: 31.2667px;"><td style="height: 31.2667px;">Show connections

</td><td style="height: 31.2667px;">***ss --tcp --all --processes --extended --numeric*** </td><td style="height: 31.2667px;">***ss -tapen***  
</td></tr><tr style="height: 36.2667px;"><td style="height: 36.2667px;">Show routing table

</td><td style="height: 36.2667px;">***ip route show***

</td><td style="height: 36.2667px;">***ip r***</td></tr></tbody></table>



##### Set interface

<table border="1" id="bkmrk-set-ip-address%C2%A0-ip-a" style="border-collapse: collapse; width: 100%; height: 95.3333px;"><colgroup><col style="width: 24.9096%;"></col><col style="width: 47.191%;"></col><col style="width: 28.0146%;"></col></colgroup><tbody><tr style="height: 33.7333px;"><td style="height: 33.7333px;">Set IP address

</td><td style="height: 33.7333px;">***ip addr add IP/NETMASK dev DEV***</td><td style="height: 33.7333px;">***ip a a IP/NETMASK dev DEVICE***

</td></tr><tr style="height: 30.8px;"><td style="height: 30.8px;">Set device up

</td><td style="height: 30.8px;">***ip link set DEV up***

 </td><td style="height: 30.8px;"></td></tr><tr style="height: 30.8px;"><td style="height: 30.8px;">Set device down

</td><td style="height: 30.8px;">***ip link set DEV down***</td><td style="height: 30.8px;"></td></tr></tbody></table>



##### Add VLANs


<table border="1" id="bkmrk-add-vlan-to-link-ip-" style="width: 100%;"><colgroup><col style="width: 24.9213%;"></col><col style="width: 75.0788%;"></col></colgroup><tbody><tr><td>Add VLAN to link

</td><td>***ip link add link DEV name DEV.VID type vlan id VID***

</td></tr></tbody></table>


##### Delete device addresses

<table border="1" id="bkmrk-delete-ip-address%C2%A0-i" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 24.9096%;"></col><col style="width: 47.191%;"></col><col style="width: 28.0146%;"></col></colgroup><tbody><tr><td>Delete IP address </td><td>***ip addr del IP/NETMASK dev DEV***</td><td>***ip a d IP/NETMASK dev DEVICE***   
</td></tr><tr style="height: 30px;"><td>Delete all IPs</td><td>***ip addr flush dev DEV***</td><td>***ip a f dev DEVICE*** </td></tr></tbody></table>



##### Set gateway

<table border="1" id="bkmrk-set-standard-gateway" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 25.148%;"></col><col style="width: 46.9526%;"></col><col style="width: 28.0146%;"></col></colgroup><tbody><tr style="height: 30px;"><td>Set standard gateway   
</td><td>***ip route add default via IP***   
</td><td>***ip r a default via IP*** </td></tr></tbody></table>