-
-
Notifications
You must be signed in to change notification settings - Fork 2
IP Network Interface
Mattscreative edited this page Dec 5, 2025
·
2 revisions
-
ipis the modern replacement for older network commands likeifconfig,route, andarp - Part of the
iproute2package (usually pre-installed) - More powerful and feature-rich than legacy commands
- Used for configuring and troubleshooting network interfaces
What ip can do:
- Show network interface information
- Configure IP addresses
- Manage routing tables
- Show network statistics
- Troubleshoot network connectivity
ip addr showShort form:
ip aWhat this does:
- Shows all network interfaces and their IP addresses
- Displays interface status (UP/DOWN)
- Shows IPv4 and IPv6 addresses
Example output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host noprefixroute
valid_lft forever preferred_lft forever
2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether ec:75:0c:66:f1:7b brd ff:ff:ff:ff:ff:ff
inet 192.168.2.152/24 brd 192.168.2.255 scope global dynamic noprefixroute enp6s0
valid_lft 231092sec preferred_lft 231092sec
inet6 fe80::ee75:cff:fe66:f17b/64 scope link noprefixroute
valid_lft forever preferred_lft forever
What it shows:
- Interface name (lo, enp6s0, etc.)
- Interface state (UP/DOWN)
- MAC address (link/ether)
- IP addresses (inet for IPv4, inet6 for IPv6)
- Network mask and broadcast address
ip addr show enp6s0Short form:
ip a show enp6s0Shows information for a specific network interface.
ip link showShort form:
ip lWhat this does:
- Shows link layer information (Layer 2)
- Displays interface status and MAC addresses
- Shows if interface is UP or DOWN
Example output:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp6s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether ec:75:0c:66:f1:7b brd ff:ff:ff:ff:ff:ff
ip route showShort form:
ip rWhat this does:
- Shows the routing table
- Displays default gateway
- Shows network routes
Example output:
default via 192.168.2.1 dev enp6s0 proto dhcp src 192.168.2.152 metric 100
192.168.2.0/24 dev enp6s0 proto kernel scope link src 192.168.2.152 metric 100
What it shows:
- Default route (default via)
- Network routes (192.168.2.0/24)
- Interface used (dev)
- Source IP (src)
sudo ip link set enp6s0 upWhat this does:
- Activates a network interface
- Brings interface online
sudo ip link set enp6s0 downWhat this does:
- Deactivates a network interface
- Takes interface offline
sudo ip addr add 192.168.1.100/24 dev enp6s0What this does:
- Adds an IP address to an interface
-
/24is the subnet mask (255.255.255.0)
sudo ip addr del 192.168.1.100/24 dev enp6s0What this does:
- Removes an IP address from an interface
ip link show enp6s0Look for state UP or state DOWN.
ip addr show enp6s0Check if interface has an IP address assigned.
ip route showLook for default via entry.
ping -c 4 8.8.8.8Tests internet connectivity.
ip a # Show all addresses
ip a show enp6s0 # Show specific interface
ip l # Show all links
ip r # Show routing table
sudo ip link set enp6s0 up # Bring interface up
sudo ip link set enp6s0 down # Bring interface downFor network connections, see the SS Network Troubleshooting Guide.