//TODO
[ ] ip
vs iptables
各自用在什么地方?
my question: https://unix.stackexchange.com/questions/608560/what-is-the-difference-between-iptables-and-ip-route-table
ip
command in Linux is present in the iproute
package which is used for performing several network administration tasks. IP stands for Internet Protocol.
ifconfig
is obsolete, ip
is preferred.
It can perform several tasks like configuring and modifying the default and static routing, setting up tunnel over IP, listing IP addresses and property information, modifying the status of the interface, assigning, deleting and setting up IP addresses and routes.
Explanations: Linux ip Command with Examples Linux manual page: ip
Most frequently used subcommands:
- link (l) - Display and modify network interfaces.
- address (a) - Display and modify IP Addresses.
- route ® - Display and alter the routing table.
- neigh (n) - Display and manipulate neighbor objects (ARP table).
- netns - deal with network namespace
The configurations set with the ip command are not persistent. After a system restart, all changes are lost. For permanent settings, you need to edit the distro-specific configuration files or add the commands to a startup script.
address
Show all IP address associated with all interfaces that are available
1 | ## ip address |
link
It is used to display link layer
information, like MAC address, it will fetch characteristics of the link layer devices currently available. Any networking device which has a driver loaded can be classified as an available device.
1 | ## show statistic of device with human readable format |
route
This command helps you to see the route packets your network will take as set in your kernel routing table. The first entry is the default route.
Other commands perform the same: route
, netstat -r
1 | ip route |