With Kubuntu, as well as other linux operating systems, you have two methods of getting your network up and running. By this, I mean accessing the Internet. If you need to access a local network which has Windows computers running on it, you will need to use SAMBA (which uses the SMB networking protocols in Windows). That will be beyond this post, however I may touch on it in a future post.
I chose Kubuntu over Ubuntu, because the graphical networking configuration seemed a little easier to manage. I’ve had various networking courses, and have configured a lot of different networks on Windows (and some Linux networks), but Ubuntu’s graphical network configuration threw me for a loop. Kubuntu, however was simple to manage.
In Kubuntu for the most part, the networking will happen automatically. You shouldn’t have to do anything, unless of course you don’t have DHCP enabled on your system (if you use static IP’s for example). If it doesn’t connect automatically and your cables are plugged in, then you can use the Manage your Connections to create the connection.
If the connection is there, however you want to specify your IP address or DNS Servers, you can do this via the Manage Your Connections option, or use the command prompt. In Kubuntu, you’ll use “sudo vi /etc/network/interfaces” to configure your IP address, Subnet Mask, and Default Gateway. You’ll use “sudo vi /etc/resolv.conf” or “sudo emacs /etc/resolv.conf” to configure your DNS Servers. These commands open up the command line editors vim or emacs respectively and load the requested file.
Before you attempt to configure your connections, you will want to run ifconfig and iwconfig in order to find out which connections you need. ifconfig is the Linux equivalent of “ipconfig” in Windows (and shows you the interfaces that are active), and iwconfig does the same for wireless connections.
For example, to configure your IP address via the command line to 192.168.2.2 with a subnet mask of 255.255.255.0 and a default gateway (the router) of 192.168.2.1 (on eth0), you will enter the following:
sudo vi /etc/network/interfaces
And inside of the file, you will edit the appropriate connection (denoted by eth0, or something similar)
You would type the following to edit eth0:
iface eth0:1 inet static
After saving and exiting vi, you would enter the following to restart your network with these values:
sudo /etc/init.d/networking restart
Breaking down the components if the /etc/network/interfaces file, we have the following:
- auto eth0:1 This is the interface or Network Interface Card id, and the :1 is a sub-interface, which is more advanced than what I’ll cover here.
- iface eth0:1 inet static This tells the networking configuration that you are configuring interface (iface) eth0:1 as a static IP Address.
- address is the IP address that you are using
- netmask is the subnet mask of the network range.
- network is the network ID number (Major network, if you will).
- broadcast is the IP address that the network uses to broadcast to all addresses on the network at one time.
- gateway is the IP address of your default gateway (the router, switch, or modem that your network is all connected to).
I covered configuring the DNS entries in my post on Configuring your DNS Servers on Linux.
Have a great day:)