guy labs guy labs

Configure a static IP in Ubuntu 13.04

    Today we want to configure Ubuntu to use a static IP address instead of a dynamic one (from a DHCP server). 1. To do this we first need to switch from the default dhcp mode to the static mode. Open up the /etc/network/interfaces file and remove everything and add the following: Ok lets go through the properties we set here: The first two lines configure the loopback interface. These are default and shouldn't be touched, unless you have a specific purpose. The next two lines configure the eth0, the default wire connected interface. As you see it configures this it as static interface. The properties we set till the dns properties should be self-explanatory. The last the properties are about the DNS server. If you have a locally installed one you can configure it here with the dns-search and the dns-domain property. If you don't have one you can use the ones from Google, namely, Save the file and exit the editor. 2. Ok now we need to delete the old config which generates the resolv.conf file and we need to remove the DHCP client. Please execute the following commands: 3. Ok no it's time to restart the network interface with the following command: This command executes the two packed command in order, such that we don't get disconnected while executing a ifdown and then we can't start it with the ifup. (In case you are connected via SSH) You can check the result by opening the nohup.out file in the folder where you ran the previous command. 4. Now we...