How do I add an IP address with the ip command?▼
Use ip address add with a PREFIX like 192.168.1.1/24 followed by dev and the interface name. Optional keywords include broadcast, label, scope (host, link, global), lifetime values, and flags such as nodad or noprefixroute.
What object types does the ip command support?▼
The ip command supports objects including address, link, route, rule, neighbour, tunnel, xfrm, netns, maddress, mroute, mptcp, l2tp, vrf, tuntap, nexthop, ntable, token, tcp_metrics, ioam, fou, macsec, netconf, sr, stats, and monitor.
What NUD states are valid for ip neighbour entries?▼
Valid NUD states are permanent, noarp, reachable, stale, none, incomplete, delay, probe, and failed. These states describe the reachability lifecycle of ARP and NDISC cache entries and can be used for filtering with show or flush.
How do I create a policy routing rule with ip rule?▼
Use ip rule add with selectors such as from, to, fwmark, iif, oif, ipproto, sport, or dport, then an action like table, nat, or goto. Selectors match packets while actions determine which routing table is consulted.
What tunnel modes does ip tunnel support?▼
Supported tunnel modes are ipip, gre, sit, isatap, vti, ip6ip6, ipip6, ip6gre, vti6, and any. Each mode is set with the mode keyword alongside remote and local endpoint addresses, keys, TTL, and checksum options.
Does the ip command support JSON output?▼
Yes, the -j or -json global option produces JSON output, and -p or -pretty pretty-prints it. Other global options include -brief for tabular output, -oneline for single-line records, and -color for colored output.