How to setup Internet Connections in Ubuntu
This blog is divided into four parts:
- Setting up your wired Internet Connection.
- Troubleshooting wired Connections.
- Setting up your wireless adapter.
- Installing Firestarter Firewall.
Let’s get started with the first topic.
Internet Connection Setup in Ubuntu (Wired)
Before I go into this detailed technical babble, I want to go over a basic check list for connectivity to the Internet.
- Cable/DSL modem is powered on and is authenticated with your ISP (meaning, the “Cable” or “DSL” light on the front is on solid, and you have a good connection to your ISP).
- Your cable modem is directly attached to your PC Ethernet port via a Cat5 Ethernet cable. If you have more than one PC in your house and you own a router see the next item:
- Your Cable/DSL modem is attached to your router’s up link port via a Cat5 cable, and your PC is attached to one of the routers down link ports.
- Once again: DOUBLE CHECK YOUR PHYSICAL LAYER and make sure everything is correctly connected.
Kind of like this:

The above is the standard connection scheme of a home network. If you have done the above, shoot for the moon and try to open Firefox and visit www.google.com. If it says the page can’t be displayed, try clicking (inside of Firefox) Edit>Preferences and then select the Advanced catagory at the top-far-right, and then click the Network tab (see below).

From there, click on the Settings button within the Connection zone of the window. This window will then appear:

From here, make sure the “Auto-Detect Proxy Settings” radio button is selected (as above). Then hit OK.
Now, close Firefox, restart it and attempt to visit www.google.com again. If it still doesn’t work, read below to troubleshoot your connection:
Connection Troubleshooting
(skip if you’re not having any problems)
Typical Internet users have to have the following equipment in order to get access to the Internet:
- A modem (Could be dial up, could be DSL, could be cable. All three perform the same basic function: Modulate and demodulate data as it is sent to and received from your Internet Service Provider, as well as assign you one single IP address).
- An Ethernet Adapter.
- A Router (required if you have more than one computer in the house and you want them to access the Internet simultaneously).
Another networking device that is similar to a router, but inadequate for Internet connection management between more than one computer, is a Hub. Hubs are devices that do absolutely no routing of traffic with IP address, but instead, can only route traffic based on MAC addresses. Hubs were originally designed for LAN networks that did not need Internet access; only shared access between local, in-house computers. Hubs are also bad for security reasons, since they are nothing more than repeaters that echo all traffic out of every port on the device.
Basic Internet connectivity requires IP address routing capability (a router, in other words), as well as default gateway and DNS addresses to either be known in advanced, or (much more often) auto-configured by the modem/router using DHCP. In Ubuntu, DHCP is enabled on all Ethernet devices by default. This means that when you turn your computer on, it should ask the router (or cable/DSL modem) “What is my IP address, subnet mask, and default gateway supposed to be?” And the router replies and assigns the client PC an unused IP address along with the rest of the requested information. In this way, multiple computers on a LAN can be dynamically assigned IP addresses by the router as they are needed.
So the first thing you should check is if your computer is being assigned an IP address by the router at all. A quick way to do this is to open Applications>Accessories>Terminal, and once it is open, type in “ifconfig” (which is short for Interface Config). The readout will look similar to this:

In the above screenshot, you’ll see interface names listed down the left side (in this case, there are only two shown: eth0 and lo — which stands for “loopback”). These names vary depending on the type of networking device you are using. Another example: if you had more than one Ethernet adapter in your computer, you would likely see the second one listed here as “eth1″.
To the right of “eth0″ we see a lot of information written out for us. The “inet addr:” is your Local IP address. (In the above example, the IP address assigned to the computer is 192.168.73.129). If you have an address here, then that means your router/modem properly assigned you an address while booting your PC. If you don’t see an ip address here, you can attempt to force your router to assign you one by typing in “dhcpcd eth0″ and pressing enter. (Note: dhcpcd is not installed by default. To installed it from terminal, type “sudo apt-get install dhcpcd”).
An alternative place to check and see if you are being assigned an IP address is System>Administration>Network Tools applet:

Unlike the ifconfig command, you can only view the IP addressing information for one network device at a time in here. And other than that, you can’t do much here when it comes to setting up your device.
The other place to check your network settings is in System>Administrator>Network. In here, you should select your Ethernet device and make sure it is in “Roaming Mode”, which places the device into DHCP mode.
If you’re still not able to get an IP address assigned to your networking interface then the cause might be a bad cable, the modem/router may need to be reset or your network interface is broken or unsupported (rare). E-mail me if you are still having trouble.
Setting up a wireless adapter
Wireless adapters in the world of Linux have a history of incompatibility looming over them that still makes people hesitant to bother even trying Linux out because it’s thought the probability of their wireless adapter working out of the box is low. That presumption is gradually moving further and further away from the truth, and thanks to Ubuntu’s Restricted Drivers Manager, it’s moving by leaps and bounds.
For starts, check your Update Manager to ensure your system is running with the latest set of drivers and kernel headers, as well as updated software. You can do this by running System>Administrator>Update Manager. The next thing you’ll want to do is check System>Administrator>Restricted Drivers Manager to see if your wireless device uses proprietary binary drivers that need to be enabled. That might sound like a bunch of Greek, but after you open Restricted Drivers Manager, all you have to do is check off any un-checked items, and restart your computer. In most cases your device will work instantly upon reboot.
The next step to getting your wireless device connected to a wireless network is to tell it which one you want to connect to. A program that makes this simple is called WiFi Radar and it allows you to browse the airwaves for nearby access points and authenticate with them if you have the proper encryption key.
The fastest way to install Wifi Radar is to open a Terminal window and type in the following:
- sudo apt-get install wifi-radar

You can now open WiFi Radar by clicking Applications>Internet>WiFi Radar.

Once you have WiFi Radar loaded, all you have to do select the WiFi Network you would like to connect to from a list of detected networks, click connect, and then type in any necessary WEP/WPA encryption passwords. I would strongly recommend you configure your router to use WPA encryption, as WEP is an old, obsolete encryption method which can be hacked in a matter of minutes. WPA is much stronger.
SPECIAL NOTE ON WIRELESS LAPTOPS: If you have a laptop with a wireless adapter built in, check your BIOS settings to make sure the device is enabled when the computer is first turned on, and that the ability to switch it on and off can be done by the operating system, and not by the user. A friend of mine once brought me a Dell Dimensions 1300 and we couldn’t figure out why his wireless adapter was being detected, but no wireless networks were being displayed for us to select from. I was stumped when I first came across this problem, but after changing the BIOS settings as noted above, I had no problems with it after that. In most cases, wireless devices on some laptops can be controlled by what’s called a soft-switch, usually a keyboard combination like Functionkey-F2, a media button or a physical switch to enable and disable the card.
I can’t go into much detail about setting up your wireless router, but I can give you a check list of things to do to help you set it up and secure it. Configuring these settings into your router will be up to you, so consult with the manual of your router to find out how you can configure it manually. In most cases, you have to type “192.168.1.1″ or a similar IP address into the address bar in a web browser like Firefox, and then enter the default Admin password.
Here are some tips to keep in mind when setting up your wireless network:
- Use WPA encryption if possible, and not WEP.
- Consider adding MAC address filters to prevent unwanted users from attaching to your router.
- Once you have your wireless adapter configured to connect to your wireless network correctly, disable ESSID broadcasting.
- Change the routers Administrator password. For added security, make it something different from your WPA encryption password.
- Write your WPA and Admin passwords down on a post-it note and stick it to the bottom of your router. (This sounds self-defeating in terms of security, but if a person can physically touch your router and you don’t want them messing with it, you should find a better place to put it. Because all they have to do to give you a headache is press the reset button).
Installing and Running Firestarter Firewall Software
Firestarter is an effective, lightweight and easy to use firewall administration program that allows you to monitor active connections between your computer and others, set access rules and otherwise help make your system more secure. Firestarter also allows you to easily setup Internet Connection Sharing if you have multiple networking devices available.

To install Firestarter, type the following into terminal:
- sudo apt-get install firestarter
Once installed, you can find this application in your System>Administration menu. The program has documentation located here, including a simple introductory tutorial. To get it to run when you boot, click System>Preferences>Session. Click on the Add button, then in the “command” line, type “firestarter” all lower-case, and you should also name it firestarter as well. Once you have those two fields populated, click ok, and that’s it!
As always, drop me a comment or e-mail if you have questions or feedback.
Tomorrow, I’ll show you how to edit your Grub boot menu so you can change your default OS!
March 22nd, 2008 at 8:08 pm
I am trying to get Ubuntu working to access the internet. I have a window’s XP machine connected to a 2Wire combination dsl modem/rounter. I have the Ubuntu machine connected to a Linksys WET54G wireless ethernet bridge. The link is fine. If I connect the window’s machine to the bridge, I can access the internet. On the Ubuntu machine, I can see the WET54 AND the 2Wire gateway if I set the ethernet to a fixed IP address. However, when I try to access the internet, I cannot see any sites that are not explicit IP addresses. When I switch the Ubuntu machine to dhcp, I cannot see either the bridge or gateway or the internet either. I did connect the Umbuntu box directly to the rounter and it did work OK for the internet when set to DCHP. So… What is different when I connect the Umbuntu machine to the WET54? I’m lost and neither AT&T or Linksys tech support will talk to me when I mention Linux is part of my system.
Thanks!
March 22nd, 2008 at 11:03 pm
First, this problem sounds like your WET54G isn’t assigning your Ubuntu machine the correct DNS address, or is not configured correctly (you are not the only one who has had this specific problem with the WET54G bridge). From what I’ve seen online so far about this bridge, it does not support functioning as a DHCP server, which explains why it is not assigning you an address when you attempt to place your eth0 into DHCP.
You should set your address to be static, and you should also manually set a DNS resolve address in Ubuntu by doing the following in Applications>Accessories>Terminal:
sudo gedit /etc/resolv.conf
This will open the resolv.conf file in Gnome Text Editor with root privlages. On the line “name server xxx.xxx.xxx.xxx” replace the x with the IP of your name server (obtain this DNS address from your router, or your Windows PC attached to it by throwing a ipconfig /all at it). Then save the config file with the new name server address. After that, you can restart your network components by typing:
sudo /etc/init.d/networking restart
Also keep in mind that if you assign a static IP address to a computer that it has to be within the same network “broadcast domain/subnet” as the rest of the network you’re wanting to communicate with. Simply look at the IP address that is being assigned to the bridge (may have to see it’s config, or look at the routers “attached devices” status to see what it’s getting). If the bridge is being assigned 192.168.1.226, you should assign your computer an ip address of 192.168.1.227, with a subnet mask of 255.255.255.0, and a default gateway… try the IP address of the bridge first, and that should do the trick.
Good luck!
March 22nd, 2008 at 11:05 pm
By the way, chances are the reason you didn’t have a problem with your windows PC is that the DNS address may have been cached, and reused when you tested it on the bridge.
June 14th, 2008 at 2:22 am
Hi how do i start the firewall on default when system starts up?
June 14th, 2008 at 8:41 pm
No ports are open on your system by default, though if you want to modify the rules your firewall operates on, or if you want to view the status of current connections, you can use a program called Firestarter.
Firestarter can be installed via Applications>Add/Remove>Search for “Firestarter”.
To get it to run when you boot, click System>Preferences>Session. Click on the Add button, then in the “command” line, type “firestarter” all lower-case, and you should also name it firestarter as well. Once you have those two fields populated, click ok, and that’s it!
December 5th, 2008 at 5:05 pm
when entering sudo apt-get install dhcpcd, im asked for a password how do i enter this ?
Regards
December 6th, 2008 at 1:39 pm
@ luke:
You type your password. You will not see any asterisks ***** appear while typing.
December 7th, 2008 at 1:28 am
Hi, i am just starting with ubuntu but i think i have a strange thing going on: Ubuntu 8.10 is installed next to Windows Vista Home ed. on a Packard Bell Notebook. Now, when i start Ubuntu and start Firefox I can search Google but so far only 1 site revealed any content. All other links i have tried so far did not give any result (except some links within google.nl). I use an ADSL router with ethernet connection. The router is a SpeedTouch 780
December 7th, 2008 at 1:35 am
I don believe it, the message is gone but this was only displayed when i selected another connection and just during the switch my answer was sent. It must have something todo with settings. See what happens with this message.
January 3rd, 2009 at 2:37 pm
Can someone please help me? I am trying to connect to the internet and I don’t know where to start to be honest. I have searched and BEN and AirWave have come up and I click on one. It says I need the password. (????????????) What is the password if you know it, or if not can you tell me where to locate the password?
Thanks.
January 3rd, 2009 at 6:44 pm
Daisy,
If you are attempting to connect to a secured (encrypted) wireless network, you have to know the passwords in advanced before the network will grant you access. You can obtain this from the owner of the wireless device you are trying to connect to. If you are trying to steal the Internet from your neighbor and they all use encryption, you should purchase your own Internet access from a local ISP, or visit a public place (like a coffee shop, hotel or library) that has free wireless Internet access available to you.
The only other password prompt that may appear is the keyring manager. It is intended to help you manage multiple passwords to different things, including wireless networks. This will allow you to store many passwords behind one master password. However, you do have the option of not setting a master password, which will allow your computer to connect to a secured wireless network automatically provided you’ve connected to it once before and the password has not changed since your last connection.
May 1st, 2009 at 10:26 pm
i have installed ubuntu for a friend every thing is ok
but he shares the network in a large group and the provider using mikrotik server
in windows there was a login page automatically opens when he tries to open any website he type the login name and the pass and go on
but on ubuntu that login page did’nt come up and ofcourse there is no internet connection
note that the pc is working with the internet good with any other network without that mikrotik
thanks for your help
May 3rd, 2009 at 10:40 pm
I’m not familiar with mikrotik. I would suggest you consult with http://www.ubuntuforums.org to see if anyone in their Networking forums can help you further.