|
|
3. Using the USB interface instead of an ethernet card3.1. USB CDCEtherIf you wish to use the USB interface to accept data you will need USB subsystem support in your kernel, whether USB-ohci, USB-ehci, or whichever USB host controller driver type your system prefers. For a more in-depth discussion of this, I direct you to the Linux-USB project site. Assuming you have USB subsystem support, to find out if your kernel supports the CDCEther (Communications Device Class Ethernet) driver as a module, in a shell, issue the command lsmod as root. You should see output similar to the following, though a number of entries have been edited, and you shouldn't worry too much if you don't see the exact entries displayed here:
If you don't see CDCEther listed among the modules try loading the module directly:
If all goes well you should see the following message in your system log files, or with dmesg:
If you don't have it compiled as a module, check the output of dmesg (you may need to pipe it through 'less' or 'more' like so: dmesg | less); if the driver loads as a module you will see a message similar to the above at boo- up. If not, and you want 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 shown next will need to be selected. As an aside, you should be aware that compiling things as modules, rather than statically within the kernel, gives you a greater degree of control and greatly simplifies troubleshooting. 3.1.1. Kernel RequirementsIn addition to the 'TCP/IP networking' listed in Section 2, the following should be compiled in your kernel in the 'USB support' menu (assuming you are using menuconfig):
3.1.2. Grabbing the Correct InterfaceNow we have to select the correct ethernet interface (/dev/ethX) to be the receipient of the DHCP service. If you run ifconfig as root you get a list of open devices:
...where eth0 is a standard NIC, pre-configured 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. If 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 bootup. 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. For most distributions, such a script is in /etc/rc.d or a similar location. If you have an rc.local script, as in Slackware, you can simply add /sbin/dhclient to the end of the file. If you have a model rc.d script (such as /etc/init.d/skeleton in Debian) you can convert that to such a purpose. Whatever the case (either at the command line manually or appended to an init script), the command to run is as follows:
You can confirm it worked by calling ifconfig without options after your next reboot. |