Warning |
---|
Take from my old wiki article on Google Sites. |
This article was written a long time ago. It should be improved to match the tone of the rest of the website. |
These instructions are for Ubuntu Desktop. Servers by default do not use DHCP.
Assuming your existing install is picking up DHCP correctly and your network is working fine.
First you should be running this from a console. In other words, not via ssh.
Code Block | ||
---|---|---|
| ||
ifconfig |
This will list your network cards. Usually you will see eth0 as being the network card enabled. Record the highlighted entries,
Code Block | ||
---|---|---|
| ||
eth0 Link encap:Ethernet HWaddr 00:0c:29:35:62:69
inet addr:192.168.0.174 Bcast:192.168.0.255 Mask:255.255.255.0 |
Now I don't know how to get the rest on Ubuntu quite yet so I go to a Windows machine on the same network and type,
Code Block | ||
---|---|---|
| ||
ipconfig /all |
Again, record the Default Gateway, line item 9, for the Ethernet adapter Local Area Connection,
Code Block | ||||
---|---|---|---|---|
| ||||
Connection-specific DNS Suffix . : pham
Description . . . . . . . . . . . : Broadcom NetLink (TM) Fast Ethernet
Physical Address. . . . . . . . . : 00-15-C5-7F-D4-07
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 192.168.0.177
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.0.1
DHCP Server . . . . . . . . . . . : 192.168.0.1
DNS Servers . . . . . . . . . . . : 192.168.0.1
Lease Obtained. . . . . . . . . . : March 13, 2009 11:25:09 AM
Lease Expires . . . . . . . . . . : March 14, 2009 11:25:09 AM |
Next on your Ubuntu machine,
Code Block | ||
---|---|---|
| ||
sudo ne /etc/network/interfaces # Where ne is your preferred text editor |
The file may look like this,
Panel |
---|
# This file describes the network interfaces available on your system # The loopback network interface # The primary network interface |
We modify the file to look like this where I chose 192.168.0.50. Note that this ip address would never be assigned by my router as I modified it's dhcp address range to only be between 192.168.0.100 to 192.168.0.255. My router itself is using the ip address 192.168.0.1.
Panel |
---|
# This file describes the network interfaces available on your system # The loopback network interface # The primary network interface # iface eth0 inet dhcp |
If you have not already, make sure are running from the console for this step. Otherwise you will be disconnected and have to connect again with the new ip address.
Now we restart the network services,
Code Block | ||
---|---|---|
| ||
sudo /etc/init.d/networking restart |
Verify by pinging your system from another machine.
After you know things are working you want to uninstall the dhcp package as after a certain amount of time it will take control and you will end up with a dhcp assigned ip.
Code Block | ||
---|---|---|
| ||
sudo apt-get remove dhcp3-client |
Notes
I have also seen, dns-nameservers 208.78.97.155 208.75.87.250 (of course using your own numbers) being used but my dns seems to work just fine.
Questions for the You Reader
References