With a built in feature called Internet connection sharing you can easily share the connection from one mac to anorther.
How to set up internet connection sharing on a MacTo get started, first open up the System Preferences window (found under the Apple menu in the menubar), and go to Sharing. Here, in the menu on the left hand side of the window, you will see an option that says internet sharing. Click on it (you can check the checkbox right now or after you finish configuring it). Then, configure the options to the right.
In my case, as shown in the screenshot, I'm sharing my wireless (AirPort) connection from my laptop to a desktop computer via a crossover cable (or an ethernet or FireWire cable will work as well. Since my laptop has a network card that has "cable management" any cable cross over or regular ethernet will work).
Then, all you need to do is check the checkbox beside internet sharing if you haven't already, and plug in the other end of the ethernet/firewire cable into the other computer.
The other computer will react as though it received a cable/airport connection straight from the router, or your modem, without knowing the difference.
Also, this should work between a mac computer (provided the mac is the one sharing its connection) and a Windows based or GNU/Linux or Unix based computer.
A couple of notes:Firewall: If you have the firewall on either one or both of your computers, you're going to want to add an exception for internet connection sharing. If you are on Snow Leopard, your Mac should as you about adding an exception automatically. If not open System Preferences, click Security, go to the Firewall tab, and click advanced. Here, click the + sign and add "/usr/libexec/InternetSharing" to the list, and choose the option Allow Incoming connections. This should allow Internet Sharing to do its job.
Only one computer shares its connection: You should make sure that only one computer has internet sharing disabled, if both have it enabled, the one without the real internet connection (either through ethernet or wireless) will simply try to create a local network, and assign itself a local IP instead, which isn't very helpful for creating an internet connection.
Got a question, tip or comment? Send them to firstname.lastname@example.org and we'll try to answer it in a blog post!