I am about to set up a pc with ubuntu server 14.04.1. I want to assign it a static ip address. How can I find a valid IP address that is not already being used? Is there a way to do that from terminal?
I am about to set up a pc with ubuntu server 14.04.1. I want to assign it a static ip address. How can I find a valid IP address that is not already being used? Is there a way to do that from terminal?
You can only tell by looking at the router's list of assigned IP addresses. But the best way to accomplish this is to assign a fixed address from the router, not the computer. That way, the computer will get a fixed address via dhcp without messing with the configuration at all, and without worrying about a conflict if the router assigns that address to another device first.
There's no easy way for the Ubuntu client to know what other IP addresses have been assigned on the network.
You can find the IP addresses of devices currently connected to your local network by doing
if your current machine is using the wired connection
eth0
interface (useifconfig
to see what your interface name is). These will of course change if you have dynamic addressing on those machines. On my server I just picked something well out of the range where most of the other addresses were (e.g. my gateway is10.0.0.1
and I chose10.0.0.120
).