Upgrading to Hardy Heron Ubuntu

The other day, I decided to take my computers down for the few hours it would take to upgrade to Hardy Heron. I wanted to take advantages of the new features and the improved Firefox 3. So far everyone is working very well. The upgrades went perfect, except for two issues, one on each computer.

First off, on my laptop, the host name of the computer fell out of the host file so sudo couldn’t work. This was almost a major issue, but it is very easy to fix.

Go to System-Network-General. Click on the unlock and enter your password. Next, copy that hostname listed there.

Host Name

Next, go to hosts tab and you are going to want to add the hostname localhost at ip 127.0.0.1 and the host name from the previous step at ip 127.0.1.1 . Basically, get it looking like this screenshot.

Hosts

After you finish, reboot your computer and you are back in business.

The second problem that I encountered was on my desktop. On its first reboot, it had several crash errors. I rebooted and they didn’t appear again and haven’t since. I think it’s just some legacy tracking errors.

All in all, I like the performance I am getting with the new Ubuntu.

Sharing Internet Connection with a Crossover Cable

Sometimes you want to to have two computers using the same internet connection. It’s been awhile since I last posted an Ubuntu tutorial, so it is about time. Here I discuss how to share internet access over a crossover cable.

Ok, this config would take less than a minute if I was there. Maybe it will be the same for you if you can cut and paste fast. It can be done graphically and you might want to try it for fun. The fun part about Ubuntu is that you can experiment and there is nothing better than just figuring things out.

Open a terminal and type this:

sudo cp /etc/network/interfaces /etc/network/interfacesbkup

That backed up the file we are going to work with and then this:

sudo gedit /etc/network/interfaces

Now you are going to add the setting for your network. A file will get opened in your editor. Look in the file and you will see this line:
#iface eth0 inet dhcp

Right above it you will see a line that says auto eth0. Don’t touch that line. You want to delete the #iface line and put this in its place:
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0

This sets the ip address of your LAN connection. Save the file and then exit from gedit.

Now, hook up the cable that goes between your computer and your wife’s computer then just restart networking by typing this in a terminal:

sudo /etc/init.d/networking restart

Now you are ready to use the connection.

1st, do a google search to make sure you have still internet. (IE see something went wrong). It also checks to see if we need to do any default networking.

2nd, is the other computer using Ubuntu or Windows. If the other computer is using Ubuntu as well, just change her /etc/network/interfaces file in the same way I described above, but just change the address, to 192.168.1.2 and add these lines:
gateway 192.168.1.1
dns-nameservers 192.168.1.1

If the other computer is using Windows, go into the TCP/IP properties of the connection and untick the automatically get IP address and auto nameservers. For ip address enter 192.168.1.2 , tab through the mask and for gateway use 192.168.1.1 and for dns, use 192.168.1.1

Now check if the other computer has internet. and check if you have internet. You should both be set.

Problems?
Send me another copy of your ifconfig
If for some reason you lose internet on your Ubuntu, run this command:

sudo rm /etc/network/interfaces

and then

sudo mv /etc/network/interfaces/networkbkup /etc/network/interfaces

When you restart your networking will be back to normal.

I know this is very long, but it is actually very simple, I just have a long explanation. In short, set the networking for eth0 up and then get the other computer set up.

Connecting Two Computers Using Ubuntu

On a forum, I decided to reply to a user about the ability to network two computers together in Ubuntu Linux. I decided to put the text of my response here because I think it’s very useful.

You have stumbled upon the most difficult to use facet of Linux. You have been indoctrinated that things are easier in Windows. Windows considered it a privilege to share an internet connection(some versions of Windows put restrictions on how you share an internet connection). Linux has so many different options, all you need to do is pick your poison.

How are you sharing the connection right now? I will tell you how I have shared my internet connection in the past using Ubuntu.

1) I have been connected on a USB GPRS modem to the internet under Ubuntu and shared my internet connection over a crossover ethernet cable. I merely set the default route to my modem on Ubuntu. I set up static ip addresses on both computers and on the 2nd computer I made sure it used as a the gateway the IP of the first computer, but later I found out this wasnt even needed.

2) When wireless was down in our office, I plugged an Ethernet cable into my notebook to access the net. My computer became a wireless access point. Unfortunately, no one could configure their Windows computers to access it, but my buddy using a Mac could access it.

3) In another school, we used a Linux server to be a proxy. It had two LAN cards. One LAN connected to the internet and the other LAN card connected to our internal network. It used a Squid Proxy server for all traffic.

Lots of options and they all work great.