Linux command
ip 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Example
ip address
Example
ip -br address
Example
ip -br link
Example
ip route
Example
ip neighbour
Example
sudo ip link set [ethX] up
Example
sudo ip link set [ethX] down
Add/Delete
sudo ip address add [ip_address]/[mask] dev [ethX]
Example
sudo ip address delete [ip_address]/[mask] dev [ethX]
Example
sudo ip route add default via [ip_address] dev [ethX]
说明
ip is the modern Linux networking command for showing and manipulating routing, devices, policy routing, and tunnels. It replaces the older ifconfig, route, and arp commands.
参数
- address, a
- Display and manage IP addresses
- link, l
- Display and manage network interfaces
- route, r
- Display and manage routing table
- neighbour, n
- Display and manage ARP/neighbor cache
- tunnel
- Display and manage IP tunnels
- maddr
- Display and manage multicast addresses
- rule
- Display and manage routing policy database
- -br, -brief
- Print output in brief format
- -c, -color
- Use color output
- -4
- IPv4 only
- -6
- IPv6 only
- -s, -stats
- Output more statistics
- -o, -oneline
- Output each record on a single line
FAQ
What is the ip command used for?
ip is the modern Linux networking command for showing and manipulating routing, devices, policy routing, and tunnels. It replaces the older ifconfig, route, and arp commands.
How do I run a basic ip example?
Run `ip address` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does address, a do in ip?
Display and manage IP addresses