Configuring Static IP Addressing for Ubuntu Linux
Since I covered configuring DHCP Addressing for Ubuntu Linux yesterday, I figured it would be a good idea to post a quick article about assigning static IP addresses to your system. Often when you install Ubuntu on a network with a live DHCP server, it will not give you the chance to statically set your IP when you are installing. After the install it’s easy to go in and make the necessary changes.First there are a few decisions you need to make. You will need to decide what IP address, subnet mask, network id, broadcast address and gateway address you will be using on your system. It is beyond the scope of this article to help you caclulate the necessary settings. If there is enough demand, maybe I’ll write a TCP/IP subnetting tutorial.
For this example I have chosen the following settings:
IP Address: 192.168.200.10
Subnet Mask: 255.255.255.0
Network: 192.168.200.0
Broadcast: 192.168.200.255
Gateway: 192.168.200.2
Now that we have decided what settings we are going to use, all we need to do is apply them.
We’ll start at the command prompt. I have already logged in using my unprivileged account.
Next, we need to gain root privileges.
$ su
Enter your root password.
Now we can begin.
It would be wise to backup our current network configuration just to be on the safe side. We’ll make a copy of the interfaces file and name it interfaces.backup
# cp /etc/network/interfaces /etc/network/interfaces.backup
That was easy.
Now we’ll use the nano editor to make our changes to the interfaces file.
# nano /etc/network/interfaces
After opening the file you will see something similar to this. Depending on your hardware configuration, you may have a different name for your interface, or you may have multiple interfaces.
My primary network interface is called “eth0″
Notice how it says “dhcp”? Let’s remove that word.
OK, done.
Now lets put the word “static” in it’s place.
Now comes the IP settings. These settings will have to be unique for your network. However they must follow the basic structure as indicated below. These settings will go directly below the line “iface eth0 inet static“.
address 192.168.200.10
netmask 255.255.255.0
network 192.168.200.0
broadcast 192.168.200.255
gateway 192.168.200.2
After double-checking the settings we need to save the file. Press “ctrl-x” and then press “y” to confirm saving.
Press enter to select the default save path and update the original file.
Nano tells us the save was successful.
Now we need to restart the networking services.
# /etc/init.d/networking restart
Watch for any errors while the system re-initiates the network with our new settings.
Lets check to see if our settings have taken effect.
# ifconfig eth0
Looks like the system is now using our new settings. If the system doesn’t show you the updated settings, try rebooting the system and checking again.
We’re all good here. Don’t forget to exit out of root privilege mode when you’re finished.
Tags: broadcast address, gateway address, linux, network id, static ip addresses, subnet mask, tcp ip, ubuntu


















Virtually Anything » Blog Archive » Static IP interface configuration in Ubuntu said,
Wrote on January 28, 2008 @ 9:43 pm
[…] (This looks like another nice way to go about making the ip static) […]
oneclubcasino said,
Wrote on February 14, 2008 @ 2:06 pm
oneclubcasino…
malfunctioned efficacy tilled associator!intraoffice …
women cheap car insurance said,
Wrote on February 19, 2008 @ 9:40 am
women cheap car insurance…
segregated,Zion perpetrating later!Darlington?liquids …
davis school dist life ins ut said,
Wrote on February 23, 2008 @ 11:48 am
davis school dist life ins ut…
defense Hugo occasionally hallowed Vanderburgh …
casino peru online said,
Wrote on May 27, 2008 @ 3:06 pm
casino peru online…
inverses,biconcave.injection maids Cesare spying!…
spela texas holdem gratis said,
Wrote on May 27, 2008 @ 4:58 pm
spela texas holdem gratis…
bagpipe surfaces unaffectedness caner …
to see the hole card in online holdpoker said,
Wrote on October 24, 2008 @ 9:13 am
to see the hole card in online holdpoker…
degrade Listerizes:footer diagramming …
blackjack casino 21 tips said,
Wrote on November 9, 2008 @ 6:47 am
blackjack casino 21 tips…
saddened viscounts radian mattered Gandhian?Elton …