First I was very excited when my brother asked for my help to choose him a laptop. My other task was to share our internet connection between a Desktop PC and two laptops without using switch or router. Of course the story became more interesting due to the different operating systems. I’ll try to show how to set up your home network in such situations.
Important to make sure that you have installed drivers for networking interfaces!
About the connection: cable-net, the modem is connected to the Desktop-PC with USB.
Configuring the wired interfaces:
Desktop-PC has two networking interfaces, the first (in the following text: eth0) has automatic network address through the modem (DHCP). We need to allow to the other computers in our network (in this case just one laptop) to connect to the internet through this connection .
The another network interface of Desktop-PC is eth1 – it has static address, set to 192.168.0.1 with subnet mask 255.255.255.0 . We need to connect this network card (eth1) to one of our laptops directly. I connected it first to the laptop with Windows XP, of course you can connect it to the laptop with Linux but the Internet Connection Sharing and the IP configuration becomes more complicated in that case. When connecting our Desktop-PC and laptop directly we must to use crossover (crosslink) cable! So, we connected our Desktop-PC’s card (eth1) with our Laptop’s ethernet card (in the following text: eth2). The address configuration for this card need to be also automatic – eth1 will deal for eth2 an address, subnet mask and gateway too.
Configuring the wireless interface on Windows:
At this point you have working internet connection on both Desktop-PC and laptop (with the interface eth2). We’ll share this connection with the second laptop through an ad-hoc network. First of all you need to configure the eth2 card to allow the other computers in the network to connect to the internet through this connection ( see ).
Create an Ad-hoc wireless network with your integrated wireless card (wlan0 in the following) on the laptop with Windows XP (no encryption used in this example to simplify the setup).
After creating an Ad-hoc network, set static address for wlan0, IP: 192.168.88.1, subnet: 255.255.255.0. You have configured your Windows machines, move to the laptop with Linux.
Configuring the wireless interface on Linux:
In this example I’m using Ubuntu 9.10 Karmic Koala, but you will find the same expressions on other Linux distributions and in different Network Configuration Interfaces. Create a new wireless connection and set the connection type to Ad-hoc.
The most important part is the IP configuration. On your Linux laptop for the wireless interface (wlan1) set static addresses for IP: 192.168.88.88 (actually the end of this address can be anything – in the allowed range – the only important thing is that it must be different from the last part of your static address of the interface wlan0), subnet 255.255.255.0, for Gateway and DNS set the IP address of the interface wlan0.
Apply the changes and connect to this Ad-hoc network on your Windows and Linux laptops.
If you have any question, please comment.