This could be a very frequent Network problem for Linux users . No internet connection , no LAN connection are the effects of this problem . The very basic necessity for you to get connected to the internet or access your network resources like shared folders etc is to an IP address . Your computer should get an ip address typically from a router . IN most situations routers have DHCP enabled and it should give ubuntu an ip address for internet or network access . Now incase you aren't able to access the internet or the network the first thing you should check is whether you are getting an ip address or not ( typically 192.168.0.x or 192.168.1.x ) . This tutorial would tell you what you should do if you dont see an ip address in your ifconfig output . SO here' what you need to do :

Firstly , your ifconfig output would look something like this :

prash@prash-laptop:~$ ifconfig
eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:16


Now if you look at this ifconfig output , you would notice that eth0 doesnt have an ip address . But the router i am connected to has DHCP enabled and i should be getting an ip. SO in such cases all you need to do is go to the Terminal and type sudo dhclient eth0 . This would tell ubuntu to look for DHCPOFFERS from the router is connected to. So then you would get an ip address.

NOTE: In the above example i had used the command sudo dhclient eth0 because eth0 didn't get an ip address. In your case it could be eth1 or wlan0 or whatever.. So make the necessary changes!!

3 comments

GNU அன்வர் said... @ February 22, 2009 at 7:09 AM

i have installed ubuntu 8.10 with dual boot xp in the ubuntu i couldn't connect internet but dhcp configured automatically by ubuntu i have try to load windows values in manual mode
then also it is not working
aim hath way cable router connection
can guide me in this matter my email id textmails@gmail.com

Unknown said... @ April 2, 2009 at 12:09 PM

hi, I am trying to connect my linux laptop through a cross over cable to my WIndows XP PC via ICS. The following is what i have followed:

On the XP box, you need to enable Internet Connection Sharing. This should be in your network connections, and probably in the properties of your Dial Up connection. Once this is done, then you need to make sure that both computers have network cards installed and working. After enabling ICS, it should set your Network card to a static IP address of 192.168.0.1 . This is a private IP (doesn't get routed over the internet) and is used for internal networks.

The next step is to configure your linux box. You need to have router or a share hub, but if you only have 2 computers and wanted to connect them up and share the internet connection, you need to use the twisted/cross cable to connect them up. Then configure the network information as follows:

IP Address: 192.168.0.x (where x is any number between 2 and 254)
Subnet Mask: 255.255.255.0
Gateway: 192.168.0.1

The gateway is very important as it tells the linux how to find the route through to the internet.

In your linux shell prompt type the below:

#ifconfig eth0 192.168.0.2 netmask 255.255.255.0
#route add -net default gw 192.168.0.1

To make sure that the two machines are networked, you can go to a command line and type 'ping 192.168.0.1' and press enter. Press CTRL+C to cancel the ping command.

However I wasn't still able to type an address into your browser and have it find the internet.

I thing there is some problem with the DHCP settings. PLEASE HELP ME.

Prash Babu said... @ April 2, 2009 at 8:47 PM

When you setup ICS in windows, WIndows sets up a DHCP server , so you really dont need to setup static ip.. Go to the terminal and type sudo dhclient eth0 . Where eth0 is the interface connected via crossover to your windows box.

Post a Comment