0% found this document useful (0 votes)
152 views2 pages

Ip Command Cheat Sheet: For Red Hat Enterprise Linux

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views2 pages

Ip Command Cheat Sheet: For Red Hat Enterprise Linux

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ip COMMAND MODIFYING ADDRESS AND LINK PROPERTIES

CHEAT SHEET SUBCOMMAND

addr add
DESCRIPTIONS AND TASKS

Add an address
for Red Hat Enterprise Linux ip addr add [Link]/24 dev em1
Add address [Link] with netmask 24 to device em1

addr del Delete an address


IP QUERIES ip addr del [Link]/24 dev em1
SUBCOMMAND DESCRIPTIONS AND TASKS Remove address [Link]/24 from device em1

addr Display IP Addresses and property information link set Alter the status of the interface
(abbreviation of address) ip link set em1 up
ip addr Bring em1 online
Show information for all addresses ip link set em1 down
ip addr show dev em1 Bring em1 offline
Display information only for device em1 ip link set em1 mtu 9000
Set the MTU on em1 to 9000
link Manage and display the state of all network
interfaces ip link set em1 promisc on
Enable promiscuous mode for em1
ip link
Show information for all interfaces
ip link show dev em1
Display information only for device em1 ADJUSTING AND VIEWING ROUTES
ip -s link SUBCOMMAND DESCRIPTIONS AND TASKS
Display interface statistics
route add Add an entry to the routing table
route Display and alter the routing table ip route add default via [Link] dev em1
ip route Add a default route (for all addresses) via the local gateway
List all of the route entries in the kernel [Link] that can be reached on device em1
ip route add [Link]/24 via [Link]
maddr Manage and display multicast IP addresses Add a route to [Link]/24 via the gateway at [Link]
ip maddr ip route add [Link]/24 dev em1
Display multicast information for all devices Add a route to [Link]/24 that can be reached on
ip maddr show dev em1 device em1
Display multicast information for device em1
route delete Delete a routing table entry
neigh Show neighbour objects; also known as the ARP ip route delete [Link]/24 via [Link]
table for IPv4 Delete the route for [Link]/24 via the gateway at
ip neigh [Link]
Display neighbour objects
route replace Replace, or add if not defined, a route
ip neigh show dev em1
Show the ARP cache for device em1 ip route replace [Link]/24 dev em1
Replace the defined route for [Link]/24 to use
help Display a list of commands and arguments for device em1
each subcommand
route get Display the route an address will take
ip help
Display ip commands and arguments ip route get [Link]
Display the route taken for IP [Link]
ip addr help
Display address commands and arguments
ip link help
Display link commands and arguments MANAGING THE ARP TABLE
ip neigh help SUBCOMMAND DESCRIPTIONS AND TASKS
Display neighbour commands and arguments
neigh add Add an entry to the ARP Table
ip neigh add [Link] lladdr [Link] dev em1
MULTICAST ADDRESSING Add address [Link] with MAC [Link] to em1

SUBCOMMAND DESCRIPTIONS AND TASKS neigh del Invalidate an entry


maddr add Add a static link-layer multicast address ip neigh del [Link] dev em1
Invalidate the entry for [Link] on em1
ip maddr add [Link] dev em1
Add mutlicast address [Link] to em1
neigh replace Replace, or adds if not defined, an entry to the ARP table
maddr del Delete a multicast address ip neigh replace [Link] lladdr [Link] dev em1
Replace the entry for address [Link] to use MAC
ip maddr del [Link] dev em1 [Link] on em1
Delete address [Link] from em1
USEFUL NETWORKING COMMANDS (NOT NECESSARILY PROVIDED FROM IPROUTE)
SUBCOMMAND DESCRIPTIONS AND TASKS

arping Send ARP request to a neighbour host


arping -I eth0 [Link]
Send ARP request to [Link] via interface eth0
arping -D -I eth0 [Link]
Check for duplicate MAC addresses at [Link] on eth0

ethtool Query or control network driver and hardware settings


ethtool -g eth0
Display ring buffer for eth0
ethtool -i eth0
Display driver information for eth0
ethtool -p eth0
Identify eth0 by sight, typically by causing LEDs to blink on the network port
ethtool -S eth0
Display network and driver statistics for eth0

ss Display socket statistics. The below options can be combined


ss -a
Show all sockets (listening and non-listening)
ss -e
Show detailed socket information
ss -o
Show timer information
ss -n
Do not resolve addresses
ss -p
Show process using the socket

COMPARING NET-TOOLS VS. IPROUTE PACKAGE COMMANDS


NET-TOOLS COMMANDS IPROUTE COMMANDS

arp -a ip neigh

arp -v ip -s neigh

arp -s [Link] [Link] ip neigh add [Link] lladdr [Link] dev eth1

arp -i eth1 -d [Link] ip neigh del [Link] dev eth1

ifconfig -a ip addr

ifconfig eth0 down ip link set eth0 down

ifconfig eth0 up ip link set eth0 up

ifconfig eth0 [Link] ip addr add [Link]/24 dev eth0

ifconfig eth0 netmask [Link] ip addr add [Link]/24 dev eth0

ifconfig eth0 mtu 9000 ip link set eth0 mtu 9000

ifconfig eth0:0 [Link] ip addr add [Link]/24 dev eth0

netstat ss

netstat -neopa ss -neopa

netstat -g ip maddr

route ip route

route add -net [Link] netmask [Link] dev eth0 ip route add [Link]/24 dev eth0

route add default gw [Link] ip route add default via [Link]

12/14

Copyright 2014 Red Hat, Inc. Red Hat, Red Hat Enterprise Linux, the Shadowman logo, and JBoss are trademarks of Red Hat, Inc.,
registered in the U.S. and other countries. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

You might also like