If you are using wireless at home, and you want to configure something like a wireless printer, you will first have to hook it up 'wired'--that is, via Ethernet. You can connect it directly to your router, but in my case the router is in the basement and not where I want my printer to be--it's easier to move my laptop.
This can also be used to connect another laptop up to your system without a router or hub between them. You can connect directly with just an ethernet cable, because the Mac (at least newer ones) have auto-sensing ports. This can be used for faster/secure file transfer, as well as giving the other laptop access to the internet by sharing your connection in the following cases
- other laptop doesn't have a wireless
- you don't want to share the key/password for your network
- you want to observe the traffic of the other computer for research or forensic purposes (make sure you have consent of the parties)
- you have a 3G, cellular network, or other network connection that the user can't connect to
- any other reason you want to share
The key thing is starting the dhcp server; this allows the other machine to get an IP address allocated automatically from you (and routing information, if you are doing connection sharing). The alternative is manually configuring the IP address manually, often more trouble than it's worth, and not an option for many wireless devices like printers.
- Open sharing settings in System Preferences
- Highlight the Internet Sharing selection on the left but don't click the checkbox yet; this will show the options on the right.
- Select the interface that has the connection you want to share (the one that you are using, e.g. wireless) from the pulldown
- To computers using: Ethernet
- Click on the 'internet sharing' check box and click Start in the ensuing dialog box.
'Internet sharing' turns on a dhcp server and enables routing.
Note: that a 192.168.2.X network is used for sharing by default; you can find the rules that OSX uses in the 'man InternetSharing' entry (and you can change SharingNetworkNumberStart)--more info on this Mac OS X Hints page, be sure to read the comments.
This connection sharing can be used for more advanced scenarios as well.
Say you and a friend are on wireless, but different networks (they could be public and private, or wifi and tethered via cell phone).
You could send some traffic via one interface, and others via the other. This can be very useful to network professionals for troubleshooting.
(I usually use a squid proxy on a separate host, sometimes through an ssh tunnel, with a customized .pac proxy auto-config file; more on that later..)