sudo dhclient and hope your DHCP server assigns an IP address, default gateway, and name servers (DNS).
ifconfig on it's own only display configured network cards. It seems for now your network card is unconfigured and you are viewing your loopback adapter which is a default adaptor that should always be there.
ifconfig -a. This will display all cards available and the ethernet interface id for those cards. Look for something like
To quickly configure a card, do something like this:
sudo ifconfig eth0 192.168.0.2.
eth0 is dependant on the result of your
ifconfig -a and the IP address is dependant on your environment.
This will bring your machine online. Now you can hopefully ping your default gateway.
To assign your default gateway do this:
sudo route add default gw 192.168.0.1
Again the IP
192.168.0.1 is dependant on your environment. If you have a Windows machine you can do
ipconfig -all to get most of the required information.
Now you can hopefully ping the Internet, but you won't be able to resolve names. So you can
ping 22.214.171.124 but not
ping www.google.com. For that you have to assign a DNS server. To do this:
mc -e (Midnight Commander) but you might prefer to use
vi which is built into most Unix systems.
Add the following to
and save. Now you should be able to ping the Internet and get online using a browser. You are temporarily using Google's public name server at
At this point we normally install Webmin :-) http://www.webmin.com/
Webmin makes is 10x easier to configure and check network cards. In Webmin, use the
Network Configuration and then:
Network Interfaces (IP address)
Routing and Gateways (Default gateway)
Hostname and DNS Client (DNS servers)
menus to configure your card.
You might also want to check
/etc/network/interfaces because that is where the resultant configuration information is stored. On a DHCP enabled machine you have something like this:
user@computer:~$ cat /etc/network/interfaces
iface lo inet loopback
On a fixed IP machine you will have values like this (depends on environment):
user@computer2:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The auto command
auto lo eth1
# The loopback network interface
iface lo inet loopback
# The rest
iface eth1 inet static
Please note the above file contains just the IP address and default gateway.
The sum of our solution is to get the IP address, default gateway, and DNS servers (in
/etc/resolv.conf) right. Good luck, this can sometimes be a bit of a nightmare if it doesn't work right out the box / upgrade.