This article covers how to assign and remove multiple IP addresses to and from a single NIC. Based on your preferences, you can either assign the multiple IP addresses temporarily or permanently.
There's no simple command that you can run to determine whether the IP address on a Linux system is assigned by DHCP or static.
If it changes when the system restarts, it's clearly dynamically assigned, but even a dynamic address has some resistance to change.
The best way is to look at the configuration file.
To add a static route in Linux:
Use the route command with the –p option to add a persistent route: # route -p add default ip-address.
Use the route command with the –name option to add a persistent route by specifying a name rather than destination and gateway: # route -p add destination-address gateway-address -name name.
What is ip route command in Linux?
ip route is used to manipulate entries in the kernel routing tables.
unicast - the route entry describes real paths to the destinations covered by the route prefix.
unreachable - these destinations are unreachable.
Packets are discarded and the ICMP message host unreachable is generated.