Announcement

Collapse
No announcement yet.

Howto: Ethernet connection without a GUI

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Howto: Ethernet connection without a GUI

    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

    Code:
    sudo apt-get remove network-manager-kde
    Code:
    sudo apt-get remove network-manager
    For 8.04 and earlier

    Code:
    sudo apt-get remove network-manager-kde
    Code:
    sudo apt-get remove knetworkmanager
    Code:
    sudo apt-get remove network-manager
    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
    Code:
    ifconfig
    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.

    Code:
    sudo /etc/init.d/networking restart
    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.

    #2
    Re: Howto: Ethernet connection without a GUI

    Good post. I'm sure this will be very helpful for those who find themselves in 'Inter(not) hell' and are unable to get connected to the Internet.

    It should be stressed (for those who won't know otherwise) that this is for connecting via a wired connection.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: Howto: Ethernet connection without a GUI

      Great stuff, Detonate - you delivered right on time
      Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

      Comment


        #4
        Re: Howto: Ethernet connection without a GUI

        detonate--

        This is really a gift. Thank you. Fortunately, my wired connection works fine. It would be great if someone could do this for wifi.

        Comment


          #5
          Re: Howto: Ethernet connection without a GUI

          There's no reason this should not work for your wireless connection, but you need to make sure your wireless device is working first, then you need to put in the essid and key if it is a secured network. If you are using wireless on only one network, it's not to hard. But on a traveling laptop, you really need a network manager (I use wicd) to help you get connected.

          Comment


            #6
            Re: Howto: Ethernet connection without a GUI

            Hi,

            thanks for this post. At least it got me connected it again. Ever since this network manager stuff got introduced, I'm having problems with that connection stuff. And with Intrepid things got even worse. I wonder how they could release it this way. Two core functionalities -- namely networking and package management (i.e. adept) -- are completely broken in Intrepid. I've seen this kind of development with SuSE already. That's what made me switch to (k)ubuntu back then.

            Ok, but back to the topic. Now I have my laptop's eth0 interface configured to use dhpc as described. But now when I boot the laptop and have no cable plugged in, the boot hangs for a long time. -- Is there some way around this? I think what I'm asking for is some kind of hot-plug mechanism (Or is this exactly what the network manager is supposed to be responsible for?).

            Thanks,
            Christian

            Comment


              #7
              Re: Howto: Ethernet connection without a GUI

              When Kubuntu boots up, during the boot process it automatically tries to establish a network connection. That's what takes so long to boot when you don't have the cable plugged in. If you want to watch the boot process you can edit the /boot/grub/menu.lst file and remove the words quiet and splash from the kernel line. Then when you boot up you will get to watch all the things that happen during boot, and if it hangs, you'll know where. I'm not sure how to make it skip the networking part unless you remove networking from init.d, but then you would have to go replace it every time you wanted to boot with networking. I have the same problem because sometimes when I boot up, one of my other computers is not on, and *ubuntu can't find the NFS shared folders. Unless someone else has a better idea, I would say, learn to live with it.

              Comment


                #8
                Re: Howto: Ethernet connection without a GUI

                Hi,

                after some research in the different forums I found a fix that works. And by working I mean
                * I can hot-plug a cable in eth0 wich is then configured via DHCP
                * I can use WLAN
                * And all this with this crappy KNetworkManager

                All I had to do was to wipe out almost everything in /etc/network/interfaces leaving it with the bare essentials:
                Code:
                auto lo
                iface lo inet loopback
                Reboot and you're done. All of the sudden KNetworkManager works quite fine now.

                Maybe this helps someone.

                Christian

                Comment


                  #9
                  Re: Howto: Ethernet connection without a GUI

                  @Detonate, somehow I had missed this excellent How-To -- I'm linking to it in the "Top 20 FAQ's.

                  Thanks!

                  Comment


                    #10
                    Re: Howto: Ethernet connection without a GUI

                    Originally posted by Detonate
                    Hopefully you will see at least eth0 and lo listed.
                    Why would it be listed still, by removing those 2 packages you have just knocked out the eth0 as well. A little testing might have been an good idea as i now have to find out how to get eth0 being detected by ifconfig. Which was there prior to following your instructions.

                    And of course i cannot install them again either as i have no network connection for apt to be able to install from the repo. Thanks, but this tute is a big fail so far.

                    Now maybe you might like to tell me how to get eth0 working again, and put that into your tute to make it not so much fail

                    Comment


                      #11
                      Re: Howto: Ethernet connection without a GUI

                      I strongly suggest that you re-read it again - completely. It would also be a good idea to print it out - fully.

                      Detonate has spent a lot of time helping, not only himself with this, but others as well, before he decided to put the HOWTO together. When followed correctly, it does work.
                      Windows no longer obstructs my view.
                      Using Kubuntu Linux since March 23, 2007.
                      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                      Comment


                        #12
                        Re: Howto: Ethernet connection without a GUI

                        Removing the network manager programs does nothing to remove the actual network interface devices from your system. If you can not find any network device with ifconfig you have a problem not related to my howto. I suspect that you may have inactivated the interface with one of the network manager programs before you uninstalled them. To check and see if the interface is installed, but not active, you can enter
                        Code:
                        ifconfig -a
                        in a terminal. The -a option will cause ifconfig to list all interfaces, even if inactive. If you see eth0 then, you should be able to make it active by entering
                        Code:
                        sudo ifup eth0
                        .

                        Comment


                          #13
                          Re: Howto: Ethernet connection without a GUI

                          hm i removed the network-manager(-kde) and then all that was left over was the lo I disdn't know what to do I just reinstalled the network-manager (-kde) but of course apt-get couldn't download anything as i had only lo left...I was like "CRAP!!!" and out of desperation I just rebooted (I had /etc/init.d/network restart tried before) after the reboot i had this available again:
                          Code:
                          eth0   Link encap:Ethernet HWaddr 00:1c:25:03:b0:f3
                               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)
                               Memory:effc0000-effe0000
                          
                          eth1   Link encap:Ethernet HWaddr 00:e0:29:84:a3:bb
                               inet addr:192.168.0.240 Bcast:192.168.0.255 Mask:255.255.255.0
                               UP BROADCAST RUNNING MULTICAST MTU:1464 Metric:1
                               RX packets:63276 errors:0 dropped:0 overruns:0 frame:0
                               TX packets:43350 errors:0 dropped:0 overruns:0 carrier:0
                               collisions:0 txqueuelen:1000
                               RX bytes:52186259 (52.1 MB) TX bytes:4511878 (4.5 MB)
                               Interrupt:17 Base address:0xbe00
                          
                          lo    Link encap:Local Loopback
                               inet addr:127.0.0.1 Mask:255.0.0.0
                               inet6 addr: ::1/128 Scope:Host
                               UP LOOPBACK RUNNING MTU:16436 Metric:1
                               RX packets:1799 errors:0 dropped:0 overruns:0 frame:0
                               TX packets:1799 errors:0 dropped:0 overruns:0 carrier:0
                               collisions:0 txqueuelen:0
                               RX bytes:54763 (54.7 KB) TX bytes:54763 (54.7 KB)
                          How did this happen? I also believe this is still going with the network-manager as I get this:
                          Code:
                          reg@reg-desktop:~$ cat /etc/network/interfaces
                          auto lo
                          iface lo inet loopback
                          I'm not quite sure how I shoudl proceed from here... it's a little risky to remove the nwetwork manager and then end-up without any network interfaces....
                          also now apt-get keeps telling me:
                          Code:
                          network-manager is already the newest version.
                          The following packages were automatically installed and are no longer required:
                           linux-headers-2.6.27-7 linux-headers-2.6.27-7-generic
                          Use 'apt-get autoremove' to remove them.
                          0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
                          So network-manager is apparenrtly still installed and under control - i don't even dare to run a apt-get autoremove cause i'm afraid to end up without something i really need (network connection)...

                          How should i proceed?

                          Thanks!
                          roN

                          http://www.inetgate.biz

                          Comment


                            #14
                            Re: Howto: Ethernet connection without a GUI

                            Originally posted by reggler

                            How should i proceed?
                            What are you trying to do? It looks like your network setup is perfect, from here.

                            Comment


                              #15
                              Re: Howto: Ethernet connection without a GUI

                              Looks OK to me too, as a very wise man once said,

                              "If it ain't broke, don't fix it"!

                              Comment

                              Working...
                              X