|
|
3. Configuration
3.1. Ready to Start With an Ethernet-Modem connectionOnce you are plugged into the system, your modem is on and your dhcp server is running as outlined in Section 2.5, you should be provided your own IP address that doesn't change unless you drop the lease (i.e. are offline) for a while. To confirm that the DHCP client is working and you have a new IP address, execute (as root) ifconfig without any other arguments, and you should see the following:
...which shows the system loopback device, lo, and also eth0, the cable modem having successfully acquired an IP address (the 'inet addr') provided by our cable internet service provider. A simple Ethernet-based configuration should be complete at this step. If you have more than one Ethernet interface available and want to select a specific one for the cable service, go on to Section 3.2. 3.2. Grabbing A Specific InterfaceLet's say we want to select a specific Ethernet interface (ethX) to be the recipient of the DHCP cable internet service. If you run ifconfig as root you get a list of open devices:
...where eth0 is a standard NIC that we have preconfigured to the IP address 192.168.1.1. Note the HWaddr field, or hardware address, on the first line. This is the same as the MAC, or Media Access Control address, and is how we will specify the interface for each action. 3.2.1. Manually Assigning MAC to Interface NameWhatever distribution you use, you can always use the command line to designate an Ethernet device (via the MAC) to be interface 'ethX' with or without a particular IP address. This may be necessary when you change your settings, swap out hardware or for just plain testing. Use ifconfig:
You can check if it worked by calling ifconfig without options after your next reboot. See man ifconfig for more options. 3.2.2. Automatic Configuration of DevicesThe method for automatically assigning a particular interface name ethX, to a specific hardware interface (Media Access Control address) differs by distribution. 3.2.2.1. DebianIf you are running a Debian system, you can alter the /etc/network/interfaces file to look like this:
The auto eth0 and auto eth1 are required to have the interfaces configured at boot-up. Note that some versions of dhcp clients by default always grab eth0 for the dhcpc interface. So even after doing all the above, unless you specifically run /sbin/dhcpcd-bin eth1 it won't work. The easy way to do this at boot up is to make an init script to load the dhcp address to the correct interface, which should be placed in /etc/init.d. Then run update-rc.d as root with the correct arguments (see man update-rc.d). 3.2.2.2. Red HatThe file to edit will of the form ifcfg-ethX, located in /etc/sysconfig/network-scripts/. The contents are typically of the form:
Edit the relevant sections with your favorite text editor program as root to reflect your interface name and MAC and save it. If the file doesn't exist for the interface you need you can create it, for example ifcfg-eth1. You can then use ifconfig eth1 up from the command line to use it immediately. Upon reboot the correct hardware settings should be loaded automatically. 3.2.2.3. SlackwareSlackware has a configuration utility named 'netconfig' that you can use at the command line as root to modify your network settings and configure interfaces by static IP addresses or dhcp. You can rerun it at any time to reconfigure things once you have installed your modem. 3.2.2.4. Other DistributionsFeel free to contribute if you have distribution-specific information to add; see Section 1.5. Consult your distribution documentation where appropriate. 3.3. Using the USB interface instead of an Ethernet card3.3.1. USB CDCEtherIf you wish to use the USB interface to accept data you will need USB subsystem support in your kernel as discussed in Section 2.1, whether USB-ohci, USB-ehci, or whatever USB host controller driver required by your system. For a more in-depth discussion of this, I direct you to the Linux-USB project site. In addition the CDCEther (Communications Device Class Ethernet) protocol common to cable modems. There are two ways your kernel may support a device driver: either by being statically (always on) compiled within that kernel or loaded (at boot time or later by a script or manually) as a module. You can find out if a driver is statically compiled in the kernel by checking the log of messages at boot up using dmesg | less on the command line. Experienced users may want to take an easier route and check the configuration file for the currently running kernel in /boot, usually of the form config-2.X.x, which is a text file that can be grepped. On the command line, try grep -e followed by CONFIG_USB_CDCETHER in 2.4.x kernels or CONFIG_USB_ETH in 2.6.x kernels followed by the filename; you should see a '=y or =m at the end of this string for static or modular status, respectively. The output of dmesg | less should reveal something similar to the following
in the case of a statically compiled driver or a module loaded at boot. If you don't see it, to find out if your kernel has already loaded the CDCEther (Communications Device Class Ethernet) driver as a module, on the command line issue lsmod as root. You should see the module CDCEther listed for 2.4.x kernels, or alternatively usbnet for 2.6.x kernels. If you don't see it listed with lsmod try loading the module directly as root; for kernel 2.4.x this would be of the form
If all goes well you should see something like the following at the end of your system log files (/var/log/messages or /var/log/syslog, you may need to be root to view these) or at the end of dmesg | less from the command line:
If all goes well you should see something like the following in your system log files or at the end of dmesg:
If you are unsuccessful with any of the above, and are determined to use the USB conduit of this device, you will need to recompile your kernel to support it. You will need the 2.4.3 kernel or later. For detailed instructions on recompiling your kernel, I direct you to the Kernel-HOWTO. The options required to get USB interface support working on this device have been addressed in Section 2.1. |