IP Command Sheet – Essential Linux Networking Guide

Listen to this Post

Featured Image
This one-page Linux networking guide simplifies essential IP-related operations using the `ip` command. Below is a detailed breakdown with practical commands and examples.

You Should Know:

📌 Syntax & Structure

  • Basic syntax:
    ip [bash] OBJECT {COMMAND | help}
    
  • Show help:
    ip help
    

🌐 IP Objects

Key objects in `ip` command:

– `address` (or addr) – Manage IP addresses
– `link` – Network interfaces
– `route` – Routing tables
– `neighbor` (or neigh) – ARP table entries

🛠️ IP Options

Common flags:

– `-s` – Show statistics
– `-c` – Colorized output
– `-4` / `-6` – Filter IPv4/IPv6

📶 Manage IP Addresses

  • List all IPs:
    ip addr show
    
  • Add an IP:
    ip addr add 192.168.1.100/24 dev eth0
    
  • Remove an IP:
    ip addr del 192.168.1.100/24 dev eth0
    

🧩 Manage Network Interfaces

  • Bring interface up/down:
    ip link set eth0 up
    ip link set eth0 down
    
  • Show interface details:
    ip link show
    

🧭 Manage Routing Table

  • Display routes:
    ip route show
    
  • Add a default gateway:
    ip route add default via 192.168.1.1
    
  • Delete a route:
    ip route del 192.168.1.0/24
    

📡 Manage Neighbor Entries (ARP)

  • Show ARP cache:
    ip neigh show
    
  • Flush ARP table:
    ip neigh flush all
    

⚔️ Net-Tools vs IP Command

| Legacy (net-tools) | Modern (iproute2) |

||–|

| `ifconfig` | `ip addr` |

| `route` | `ip route` |

| `arp` | `ip neigh` |

| `netstat` | `ss` |

What Undercode Say:

The `ip` command is a powerful replacement for legacy networking tools. Mastering it improves Linux administration, troubleshooting, and security hardening. Key takeaways:
– Use `ip addr` instead of ifconfig.
– Prefer `ip route` over route.
– Monitor ARP entries with ip neigh.
– Combine `ip` with `ss` (socket statistics) for network analysis.

🔗 Related Resources:

Expected Output:

$ ip addr show 
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
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 
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP 
link/ether 00:16:3e:7a:1b:2f brd ff:ff:ff:ff:ff:ff 
inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0 
valid_lft forever preferred_lft forever 

Prediction:

As Linux evolves, `iproute2` will fully replace net-tools. Automation and cloud networking will further integrate `ip` command scripting for dynamic network management.

IT/Security Reporter URL:

Reported By: Chiraggoswami23 Linuxnetworking – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 Telegram