Broadband - setting up an ethernet ADSL modem/router
From NewbieDOC
- Chris Lale
- chrislale AT users DOT berlios DOT de
Go to NewbieDOC index
Revision History
Revision 0.1 | 11th March 2006 | Revised by Chris Lale | ||||||||||
Initial release. | ||||||||||||
| ||||||||||||
Revision 0.2 | 27th November 2007 | Revised by Chris Lale | ||||||||||
Reformatted for newbiedoc package. Added Revision History, Abstract and Licence notice in appendix. | ||||||||||||
This document is for getting an ethernet ADSL modem/router working on a Debian system. Not for a USB ADSL modem.
1 Connecting the ASDL modem/routerThese instructions are for an ethernet ADSL modem/router, not a USB ADSL modem. Assume router without DHCP (which dynamically allocates your PC an address on the network if it does not have one). You can enable Your router's DHCP server later, if it has one. Connect router's ADSL socket to telephone socket (via microfilter usually). Connect router's ethernet port to PC's ethernet socket using cat 5 cable.
2 Configuring the ethernet interfaceWithout DHCP, you have to give your PC an IP address on the router's network. Your PC must be running on the same network as your router. This network is set by default by the router manufacturer, but you can change it later. The network is usually one of the private networks in the range 192.168.nnn.0 with netmask 255.255.255.0. (The netmask means that the first three address numbers are fixed, but the fourth number can have any value.) To find the network, look in the router's documentation for the router's IP address. It is usually the first address in the network eg 192.168.nnn.1. Since the router is going to be your gateway to the internet, this will also be your PC's gateway address. In this example, the router's address is 192.168.1.1. This means that the address representing the whole network is 192.168.1.0, and the broadcast address is 192.168.1.255. (The router sometimes needs to send packets of information to all devices on the network, so every device must have this broadcast address in its configuration.) You can choose an address for your PC from the remaining addresses in the range. In this example, the PC's ethernet card is configured to use address 192.168.1.2. The configuration of your PC's ethernet card(s) is held in the file /etc/network/interfaces. If you have only one ethernet card (eth0) the file will contain two entries - one for the loopback device (lo) and one for the ethernet card (eth0). Edit the file as root and add/modify the address (192.168.1.2), netmask (255.255.255.0), network (192.168.1.0), broadcast(192.168.1.255) and gateway (192.168.1.1) addresses. You can use Nano from a terminal or terminal window to do this. $ su Password: # nano /etc/network/interfaces ... # exit $ The resulting /etc/network/interfaces file should look something like this: # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.1.2 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1 # dns-* options are implemented by the resolvconf package, if installed dns-nameservers nnn.nnn.nnn.nnn nnn.nnn.nnn.nnn dns-search home name Ethernet LAN card 3 Configuring the PC's hostname3.1 Check the PC's hostnameCheck your PC's hostname with fully qualified domain name switch $ hostname --fqdn sempron.home If you get localhost.localdomain or a hostname but no domain name, use the alias switch to find out if there is a named domain. $ hostname --alias localhost sempron sempron.home In this example the hostname is sempron, the domain name is home and the fully-qualified domain name is sempron.home. You may not have a domain name if you did not enter one when you installed Debian. 3.2 edit /etc/hostsYou can use Nano from a terminal or terminal window to do this. $ su Password: # nano /etc/hosts ... # exit $ Add the IP address for your PC if it is not present (and remove other references from eg first line). Include the hostname aliases. The /etc/hosts file should look something like this: 192.168.1.2 sempron.home sempron 127.0.0.1 localhost.localdomain localhost # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts 4 Configure nameserversYour broadband supplier may provide you with the IP addresses of its DNS servers. These are used by your router to convert domain names like 'google.co.uk' into IP addresses like 216.239.57.104. As root, modify the file /etc/resolv.conf with these addresses. It should look something like this: nameserver nnn.nnn.nnn.nnn nameserver nnn.nnn.nnn.nnn search home 5 Connect your PC to the router's networkBring up the eth0 interface with the new configuration by restarting the networking service. Do this as root. # /etc/init.d/networking restart 6 Checking the networkPower up the router. You can check that your PC can communicate with the router using Ping. $ ping -c3 192.168.1.1 PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. 64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.388 ms 64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.384 ms 64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.384 ms --- 192.168.1.1 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1999ms rtt min/avg/max/mdev = 0.384/0.385/0.388/0.016 ms If you get an error like From 192.168.1.2 icmp_seq=1 Destination Host Unreachable go back and check your documentation for the router's address. 7 Configuring the routerOpen a browser and enter the router's address in the location bar. http://192.168.1.1 Follow your router's setup instructions and configure the router with the settings, username and password from your broadband provider. Save the settings. The router should reboot automatically. If you may have leds on the front of the router. You should see this sequence:
See your router's documentation for particular details. 8 Check that you can connect to the internet8.1 Check that the router is working$ ping -c3 216.239.57.104 8.2 Check that DNS is working$ ping -c3 google.co.uk 8.3 Check that your browser worksVisit http://google.co.uk 9 Appendix A: LicenceCopyright (c) 2006-2007 Chris Lale, chrislale AT users DOT berlios DOT de
Go to NewbieDOC index |