ifconfig cheatsheet

purpose net-tools new iproute2 replacement
Address and link configuration ifconfig ip addr
ip link
Routing tables route ip route
Neighbors arp ip neigh
Tunnels iptunnel ip tunnel
Multicast ipmaddr ip maddr
Statistics netstat ss
function iproute2 command
ip address – protocol address management
show ip addresses
ip a
ip address show
ip addr show dev eth0
ip a sh eth0
add/delete ip addresses
ip address add 192.0.2.1/24 dev eth0
ip addr del 192.0.2.2/24 dev eth0
for ip in {2..254}; do ip a a 10.1.100.$ip dev eth0; done
show interface statistics
ip -s link ls eth0
ip link – network device/link configuration
show links/devices
ip link show
ip link sh eth0
set link/device state
ip link set eth0 up
ip link s gre01 down
ip route – routing table management
show routing table
ip route
ip ro show dev gre01
add new route
ip route add 10.2.2.128/27 dev gre01
add default route
ip route add default via 192.168.1.1
change existing default route
ip route chg default via 192.168.1.2
delete default route
ip route del default
ip tunnel – tunnel configuration
add/delete a new tunnels GRE Tunnel:

ip tunnel add gre01 mode gre local 10.1.1.1 remote 20.2.2.1 ttl 255

IPIP Tunnel:

ip tunl a ipip01 mode ipip local 10.1.1.1 remote 20.2.2.1 ttl 255
ip tunnel del gre01
show tunnels
ip tunnel show
show tunnel statistics
ip -s tunl ls gre01
ip neighbour – neighbour/arp tables management
view arp cache table
ip neigh show
add/delete arp entries
ip neighbor add 10.2.2.2 dev eth0
ip neigh del 10.2.2.1 dev eth0
ss – socket statistics
listening sockets
ss -l
listening processes
ss -p

 

Leave a Reply

Your email address will not be published. Required fields are marked *