Last week I had to re-install a small server after a file system failure, and I hit a gotcha which I always hit, and always forget about. This post is to try to ingrain it into my memory so I don’t waste time on it again.
To be able to connect remotely using SSH, I open a hole in the router firewall, and port forward that (non-standard) port to the Ubuntu box. This requires that the Ubuntu box has a static IP on the local network. This is easy. You go to the Network Manager configuration panel, fill in the details like IP address, netmask, gateway and dns servers, and job done.
Except it’s not, because if you use Network Manager to configure the interface for a static IP, it doesn’t use the DNS servers you specify, which is a bit of a problem. Instead, you have to disable Network Manager and set the interface up by hand.
To do this, edit the Network Manager configuration file:
sudo gedit /etc/NetworkManager/NetworkManager.conf
Change “managed=true” to be “managed=false“.
Now edit the interfaces configuration file:
sudo gedit /etc/network/interfaces
and add the following, substituting values as appropriate for your network:
iface eth0 inet static
The changes should be picked up on a restart.
It continues to amaze me that even after it has come so far, Ubuntu continues to drop clangers like this. From a user perspective, this experience is simply awful. One reason it is so irritating is that it looks like you have done everything right, using the provided tool and filling in the boxes with the correct information, but it still doesn’t work. You should either provide a tool which works as expected, or make it clear what you have to do to make it work. Don’t provide a tool which doesn’t work, and then rely on people being able to find the answer via random Google searches.