Static Networking in Kubuntu 8.04 KDE4

The Kde4 remix of Kubuntu Hardy Heron has one fairly bad flaw for a certain group of users:
It has no way to graphically configure static IP networks. Users are left to manually edit
their /etc/network/interfaces and /etc/resolv.conf. Thankfully this is not hard and the following
tutorial should explain how to do it.

EDIT: if you have another computer with Internet, or have Windows on the same computer and would like to configure the network with a GUI instead of via files…. please follow the instructions in the first comment

First, run “ifconfig” to find the name of your network card. It should be eth0, or similar (eth0 will be used throughout this tutorial).
Then, open up your /etc/network/interfaces file with “kdesudo ‘/usr/lib/kde4/bin/kwrite /etc/network/interfaces’”.
It should look something like:


auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0
auto eth0
#iface eth0 inet dhcp
auto eth1
#iface eth1 inet dhcp
#iface eth2 inet dhcp
#iface ath0 inet dhcp

first, uncomment the line which says:

iface eth0 inet static

Now we have to add some lines which are highly dependant on your individual setup and network/ISP

address 192.168.0.2

put your desired address here

netmask 255.255.255.0

netmask should always be like this, unless your ISP says different or you have set it up differently(if
you’ve done that, you probably don’t need this guide.)

gateway 192.168.0.1

This is the IP of your ISP/Router

broadcast 192.168.0.255

This should be provided by your ISP, if not, it is the first 3 sections of the gateway followed by the
first section of the netmask.

the whole section should look like this:

auto eth0
iface eth0 inet static
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.255

Now, we need to edit our resolv.conf and add our DNS nameserver(s)

open the file with “kdesudo ‘/usr/lib/kde4/bin/kwrite /etc/resolv.conf’”

add a line like so:

nameserver 208.67.222.222

This is the line for the OpenDNS nameserver, you can use the one from your ISP
by simply replaceing the above IP with their’s.

Finally, run “sudo /etc/init.d/networking restart” and you should be connected!

4 Responses to “Static Networking in Kubuntu 8.04 KDE4”

  1. Nnexxus Says:

    I have a workaround, for the people that really want to access the graphical configuration of their network.

    If you have access to the internet (via another computer, a dual boot…) you can download this package : http://packages.ubuntu.com/fr/hardy/kde/knetworkconf
    It’s the kde3.5 network configuration GUI. It seems that KDE4’s Knetworkmanager is actually part of KDE3.5, and it tries to launch KDE3.5’s network configuration GUI. At least, that’s what I understood.

    Once you have downloaded the .deb file and put it somewhere on your Kubuntu box, cd to the directory where you put the file and install it using ’sudo dpkg -i knetworkconf_3.5.9-0ubuntu5_i386.deb’.

    After that, you should be able to access the network config GUI by right clicking the KnetworkManager icon in the panel, and selecting ‘manual configuration’.

  2. nevyn Says:

    In case anyone else has run into the issue of your DNS servers being lost after a reboot.
    Symptoms:
    You’re able to access everything via their IP address but not by their name. (In a terminal) `ping google.com`results in a failure but `ping 208.67.222.220` comes back a success.

    edit /etc/resolvconf/resolv.conf.d/tail

    add lines for your DNS servers:
    nameserver 208.67.222.220
    nameserver 208.67.222.222
    (These IP addresses would change for your network or ISP. These are the OpenDNS servers)

    Open up a terminal and run:
    sudo resolvconf -u
    ping google.com

    this should come back with something similar to:
    64 bytes from xxx.xxx.xxx.xxx: icmp_seq=69 ttl=54 time=1787 ms
    Hit Ctrl-C to stop it. Type `exit` to exit the terminal.

  3. Spewbacca Says:

    Thank you both for the solutions posted !
    Together the instructions fixed the troubles I’d found after a fresh install of Hardy. Now all is well.

  4. netlurker Says:

    If you’re like me, and have a dhcp server on your network, but want your machine configured with a static IP, you don’t have to manually edit the /etc files to get back to a static setup. Assuming you have a working network/internet connection via dhcp, and just want to change it to static, “apt-get install knetworkconf” will install the 3.5 package. After that you can right-click the icon and then change your machine’s IP address as needed.

    Of course, I only found this out after manually editing the /etc files, but I appreciated your tips and thought I’d try to help those whose situation is slightly different still from the 2 setups you’ve covered so far.


Leave a Reply