IP command
Show / manipulate routing, devices, policy routing and tunnels.
The IP
command englobes a lot of functionalities from now obsolete network managing commands. Some of them are:
Obsolete commands | Equivalent commands |
---|---|
arp | ip n (ip neighbor) |
ifconfig | ip a (ip addr), ip link , ip -s (ip -stats) |
netstat | ss, ip route (for netstat -r), ip -s link (for netstat -i), ip maddr (for netstat -g) |
route | ip r (ip route) |
iproute2 ip
Substitutes commands like ifconfig, route, and arp.
ip [Options] Object [Command [Arguments]]
Objects:
- links: To configure logical or physical objects from the network.
- address: Protocol (IP or IPv6) address on a device.
- neighbor: ARP or NDISC cache entry.
- rule: Rule in routing policy database.
- route: Routing table entry.
- tunnel: Manage IP tunnels.
- maddr: Change/See multicast addresses, its properties.
- mroute: Set, change or delete the multicast routing.
- monitor: Monitor continuously the state of devices, addresses and routes.
Activate and deactivate a network device: ip link set enp0s3 up/down
Activate and deactivate ARP: ip link set dev enp0s3 arp on/off
See IP addresses: ip addr show
ip -c a
Add IP addresses: ip addr add 192.168.1.4/24 dev enp-s3
See routing table: ip route add 10.10.50.0/24 via 192.168.1.1 dev enp0s3
Add route: ip route add 10.10.50.0/24 via 192.168.1.1 dev enp0s3
Delete route: ip route del 10.10.50.0/24
Configure gateway: ip route add default via 192.168.1.1