When I run ip address show I see that the loopback network interface has 127.0.0.1/8 assigned.
This means that if I want to use the loopback network interface I can run npx http-server -a 127.X.X.X because the /8 suffix implies that in order to use the loopback interface I can use any IP address that starts with 127. For example: npx http-server -a 127.4.7.1.
ip address show also shows that the network interface called enp0s3 has 10.0.2.15/24 assigned.
However, when I attempt to use an address that is not assigned, it results in an error. For example, npx http-server -a 10.0.2.16 returns the error:
Error: listen EADDRNOTAVAIL: address not available Why is address 10.0.2.16 "not available"?
What should I do to be able to use 10.0.2.16, when only 10.0.2.15 is assigned, like with 127.4.7.1?