Recently there seems to have been a lot of posters with problems getting their internet connection working with a wired connection. Many of these problems seem to be related to the network manager not working correctly. This could be Knetworkmanager, in Kubuntu 8.04 and earlier, and network-manager-kde in 8.10.
It's nice to have a GUI to help with setup of things, but sometimes they just don't seem to work. In fact, sometimes they actually break a working system. So I'm going to explain, step-by-step how to get things working for your network and internet without using the GUI.
First thing you should do is remove any network managers you have installed. The reason we remove them is because, once you get your network up and running, those programs will try change things in the files we are going to edit, and possibly break things again. Open a terminal and, depending on your version of Kubuntu, issue one of these commands.
For 8.10
For 8.04 and earlier
And remove any other networking managers you may have installed.
Now we need to make sure that your system is actually recognizing your ethernet hardware.
Issue the command
in a terminal, and you will quickly see what interfaces are currently active. Hopefully you will see at least eth0 and lo listed. If not, you need to get eth0 working, and that is beyond the scope of this howto. Search the forum for information on getting your network card up and running, then come back here.
Next you will need to edit two files. The /etc/network/interfaces file and the /etc/resolv.conf file. Be sure and back up both files before editing them.
Open the interfaces file by issuing the command kdesudo kate /etc/network/interfaces in a terminal. When kate opens you should see something like this.
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
# The primary network interface
auto eth0
iface eth0 inet dhcp
If your file doesn't look like this, edit it. Then save the file. You should now be able to connect to a dhcp server, which is your router or cable/dsl modem if you are not using a router. This setup will get you running with DHCP. If you want to use a static IP on your network, you would change the line
iface eth0 inet dhcp
to read
iface eth0 inet static
and then enter the following lines below that.
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.0.1
Modify these lines for your system. The address must be one that will be recognized by your router and outside the DHCP address your router assigns, if DHCP is enabled in you router.
The gateway also must be the gateway of your router.
The following info is only for using a static IP. If you are using dhcp you should not have to edit the resolv.conf file.
But before you get connected, we need to tell your computer where to find the domain name server. (DNS)
That is the function of the /etc/resolv.conf file.
So let's open up that file with kate (or any text editor) by issuing the command kdesudo kate /etc/resolv.conf in a terminal. If there is no resolv.conf you will be presented with a blank page. If one already exists you will see something like this. Saving your file will modify or create the resolv.conf file.
This is what mine looks like.
nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 192.168.0.1
You can have up to three nameservers listed in resolv.conf. These are the places where information is stored that resolves urls into IP addresses. The first two listed above are for OpenDNS which is the DNS server I have been using for a long time. The last one is for my router where information is kept to allow you to access other computers on your network.
In your file, you want to put the nameserver (DNS) that matches the one listed in your router or modem. You will need to access the setup page from a browser to find out exactly what that is. You can find out how to do this by consulting you router or modem documentation.
Here's a shot of the page in my router's setup that shows us the info we need.
Uploaded with ImageShack.us
Edit your file to include those DNS's listed in your router's or modems setup, preceded by the word "nameserver" before each. Save the file (you did make a backup earlier didn't you)?
Now we are ready to see if it works. Issue the following command in a terminal.
See:
man interfaces
man resolv.conf
Note: I used the command kdesudo but in you have KDE 3.5.* you will use kdesu instead. And when I said "router" that could also refer to your modem if you are connected directly without a router. And of course you can substitute any text editior for "kate".
Please feel free to point out any mistakes or other helpful hints.
It's nice to have a GUI to help with setup of things, but sometimes they just don't seem to work. In fact, sometimes they actually break a working system. So I'm going to explain, step-by-step how to get things working for your network and internet without using the GUI.
First thing you should do is remove any network managers you have installed. The reason we remove them is because, once you get your network up and running, those programs will try change things in the files we are going to edit, and possibly break things again. Open a terminal and, depending on your version of Kubuntu, issue one of these commands.
For 8.10
Code:
sudo apt-get remove network-manager-kde
Code:
sudo apt-get remove network-manager
Code:
sudo apt-get remove network-manager-kde
Code:
sudo apt-get remove knetworkmanager
Code:
sudo apt-get remove network-manager
Now we need to make sure that your system is actually recognizing your ethernet hardware.
Issue the command
Code:
ifconfig
Next you will need to edit two files. The /etc/network/interfaces file and the /etc/resolv.conf file. Be sure and back up both files before editing them.
Open the interfaces file by issuing the command kdesudo kate /etc/network/interfaces in a terminal. When kate opens you should see something like this.
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
# The primary network interface
auto eth0
iface eth0 inet dhcp
If your file doesn't look like this, edit it. Then save the file. You should now be able to connect to a dhcp server, which is your router or cable/dsl modem if you are not using a router. This setup will get you running with DHCP. If you want to use a static IP on your network, you would change the line
iface eth0 inet dhcp
to read
iface eth0 inet static
and then enter the following lines below that.
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.0.1
Modify these lines for your system. The address must be one that will be recognized by your router and outside the DHCP address your router assigns, if DHCP is enabled in you router.
The gateway also must be the gateway of your router.
The following info is only for using a static IP. If you are using dhcp you should not have to edit the resolv.conf file.
But before you get connected, we need to tell your computer where to find the domain name server. (DNS)
That is the function of the /etc/resolv.conf file.
So let's open up that file with kate (or any text editor) by issuing the command kdesudo kate /etc/resolv.conf in a terminal. If there is no resolv.conf you will be presented with a blank page. If one already exists you will see something like this. Saving your file will modify or create the resolv.conf file.
This is what mine looks like.
nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 192.168.0.1
You can have up to three nameservers listed in resolv.conf. These are the places where information is stored that resolves urls into IP addresses. The first two listed above are for OpenDNS which is the DNS server I have been using for a long time. The last one is for my router where information is kept to allow you to access other computers on your network.
In your file, you want to put the nameserver (DNS) that matches the one listed in your router or modem. You will need to access the setup page from a browser to find out exactly what that is. You can find out how to do this by consulting you router or modem documentation.
Here's a shot of the page in my router's setup that shows us the info we need.
Uploaded with ImageShack.us
Edit your file to include those DNS's listed in your router's or modems setup, preceded by the word "nameserver" before each. Save the file (you did make a backup earlier didn't you)?
Now we are ready to see if it works. Issue the following command in a terminal.
Code:
sudo /etc/init.d/networking restart
man interfaces
man resolv.conf
Note: I used the command kdesudo but in you have KDE 3.5.* you will use kdesu instead. And when I said "router" that could also refer to your modem if you are connected directly without a router. And of course you can substitute any text editior for "kate".
Please feel free to point out any mistakes or other helpful hints.
Comment