How to share your Internet connection and set up a wi-fi network
This tutorial covers the following activities:
- How to set-up a Wi-Fi network
- How to secure a Wi-Fi network
- How to share an Internet connection with other computers on your network, either using cables, or wirelessly
- How to fully automate the network configuration process, making it easy to share your Internet connection with friends who pay you a visit
The Internet connection can be of different types (ADSL, PPPoE, etc), the hardware you can use can be different, and the computers can be running different operating systems, such as Windows, or Linux.
Prerequisites:
- A router, which can be Wi-Fi enabled, which can also be an ADSL-modem. The examples will use a D-Link DI-524, but instructions for other devices are pretty much the same.
- Optionally, an ADSL modem.
- Some information about your Internet connection; make sure you collect all the pieces of info given by your provider - name, password, addresses, numbers, etc.
- A network cable to connect the computer to the router and configure it. Usually a straight-through cable is needed, but if you don't know what that means, it is very likely that the cable you have will do :-)
- At least one computer.
The set of initial conditions can be different, because different vendors deliver their products with different default settings. It is also possible that you are dealing with a router that is already configured, but you have no clue which configuration it uses; or maybe your router is password-protected, therefore you cannot change any of the settings.
- To make sure that you're starting from a clean sheet, reset the router. Usually there is a small hole in its back panel, use a paper clip to reset the device. Note that if you just press the button, the device is reset, while press+hold for about 15 seconds will reset the device to the factory settings - this is what we need (this will reset the password and everything else).
Once you do that, the device is reset, and it is most likely that its IP address is 192.168.0.1, some manufacturers probably use 192.168.1.1, we'll get back to this later.
- Use the network cable to connect your computer to the router; the cable must NOT be connected to the WAN-port of your router, it should go into one of the 'usual' ports, usually they're numbered from 1 to N (where N is the number of available ports).
- Configure the network card of your computer to use the following address: 192.168.0.2 (which is the router's default address plus one for the last digit), and the netmask equal to 255.255.255.0; Windows users can do this via the Control Panel: click Network connections, find your card in the list, right-click and press Properties, find Internet Protocol (TCP/IP) in the list on the General tab, press Properties and fill in the fields with the data mentioned above.
- Open the console (press Start\Run, type cmd and press Enter) and execute the command ping 192.168.0.1; if everything goes by the plan, the router will respond. If you get a timed out request, check your cables and make sure they're attached properly. If the problem persists, it is possible that the router uses another default address, ex: 192.168.1.1, therefore you should go to the previous step in change the configuration of the card to another one, use 192.168.1.2. If this doesn't help, find out which default settings are used by your router. It may also be a good idea to verify that your cable is fine (the best thing to do is use a cable which is known to be working properly).
- If the router responds, it means that you can refine its configuration using the web-interface. Start your browser and open http://192.168.0.1 (or whatever address is used by your router).
- You will be asked to enter a username and a password. Usually the name is admin and the password is empty; if that doesn't work, see your router's manual to find out what the default settings are.
- If you have a D-Link router, the page will look like this, having horizontal and vertical buttons:
- Connect the router to your ADSL modem, or plug in the network cable that comes from your provider into the router's WAN port.
- Go to WAN in the vertical tab and configure your Internet access settings. This is where the information from the provider comes into action. You'll have to choose the connection type, and then fill in the fields with their respective values. If you don't know what the values are, contact the provider and find out. Here is an example of a PPPoE configuration (note, if you're not sure what some of the fields mean, try leaving them empty, there is a great chance that things will work properly). You'll need to confirm your settings by pressing the Apply button (the green one).
- The router will probably have to restart, you will be notified about this. If that's the case, open http://192.168.0.1 again after ~30 seconds. If nothing shows up, try again after another 30 seconds, as some routers need more time to initialize.
- If things are correct, it means that there is an Internet connection; you can verify that by opening the console and executing the command ping google.com or ping mysite.com. If you see that there are replies, you're on the right track. If there are no replies, it is likely that the fields in the WAN tab of the router's configuration page were not filled in properly, double-check them.
- [Note: DHCP is optional, but it is a convenient technology, so it is recommended that you follow this instruction] Now it is time to continue configuring the router. Press DHCP in the vertical tab and set DHCP to enabled; you will also have to define an interval for the addresses that will be assigned to computers. DHCP (Dynamic Host Configuration Protocol) will make it easier to connect new computers to the network, as they will be able to use the Internet connection without having to change any configuration.
- If you have Wi-Fi enabled computers, you might want to configure the wireless module of the router; switch to the Wireless vertical tab of your router's configuration page.
- Set wireless to Enabled
- Choose a network ID (SSID), ex: MyNetwork or Cherryberry
- Leave the other settings untouched; it is a good idea not to enable any security for Wi-Fi at this step. You have to make sure that it works, and afterwards you can continue experimenting.
- Milestone#1 - your system is now in a usable state, it is a good idea to backup the settings.
- Press Tools in the horizontal tab of your router's configuration page, then System in the vertical one, then press Backup Setting. You'll be offered to save the configuration file, which contains all the customizations you've made so far. You can use it to rever the router to this configuration after a reset.
At this point, Internet works, and your wireless network works too. You can connect any other computer to one of your router's network ports. The computers that are connected to the router (either via cables, or wirelessly) should be configured to obtain an IP address automatically (see step#12); if it is so - they'll be able to browse the Internet instantly.
You can say that you're done, but I insist that you follow the instructions provided below, to make sure that you employ some basic security measures.
- Switch to the Tools horizontal tab of your router, then press Admin on the vertical tab. Set a new password for the admin account, to make sure that nobody will be able to connect to your router and change its settings without your knowledge.
- Go to Home\Wireless and enable encryption. You will be offered to choose between several encryption mechanisms. WEP is the weakest, therefore you should use WPA or WPA2. But keep in mind that on Windows XP you'll have to install a special patch (Windows XP WPA2 KB893357), that allows WPA2 to be used. If you enable WPA2 encryption without installing this patch first, you will not be able to connect to the router!
- In this example we'll use WPA2 PSK (preshared key) wireless security;
- Select it from the dropdown menu;
- Enter a key, make sure it is long and not easy to guess;
- Press Apply, the router will restart;
- Next time a computer attempts to connect to the router via Wi-Fi, you will be asked to enter the key - type it, and check "remember the key" before pressing OK. From this point on, you won't be bothered with typing the key again.
- If something does not go by the plan, you can reset the router (see step#1), then use the backup made at step#14. The backup can be loaded via Tools\System, choose the backup file and press Load.
- You might also want to enable MAC address filtering, via Advanced\Filter. The details won't be covered here, if you want to do this, then you probably already know what you're doing.
- Milestone#2, if you're sure your current settings are perfect, back them up again. If you encounter any problems in the future, you use this backup to configure your router without having to go through all the steps described on this page.