old-www/HOWTO/Cable-Modem/configuration.html

700 lines
14 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Configuration</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="The Cable Modem HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Prerequisites"
HREF="prerequisites.html"><LINK
REL="NEXT"
TITLE="Notes on Specific Hardware"
HREF="hardware.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Cable Modem HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="prerequisites.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="hardware.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="CONFIGURATION"
></A
>3. Configuration</H1
><P
> </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="ETH"
></A
>3.1. Ready to Start With an Ethernet-Modem connection</H2
><P
> Once you
are plugged into the system, your modem is on and your dhcp server is running as
outlined in <A
HREF="prerequisites.html#DHCP"
>Section 2.5</A
>, 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)
<B
CLASS="COMMAND"
>ifconfig</B
> without any other arguments, and you should see the
following: </P
><P
> <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>eth0 Link encap:Ethernet HWaddr 00:D0:09:DE:D4:6F
inet addr:66.190.XXX.XXX Bcast:255.255.255.255 Mask:255.255.255.0 UP BROADCAST
RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2591777 errors:0 dropped:0
overruns:0 frame:0 TX packets:5589 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100 RX bytes:168673636 (160.8 MiB) TX bytes:1752872
(1.6 MiB) Interrupt:12 Base address:0xc400</PRE
></FONT
></TD
></TR
></TABLE
> </P
><P
> <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX
packets:5168 errors:0 dropped:0 overruns:0 frame:0 TX packets:5168 errors:0
dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1695104
(1.6 MiB) TX bytes:1695104 (1.6 MiB)</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
> ...which shows the system loopback device,
<EM
>lo</EM
>, and also <EM
>eth0</EM
>, the cable modem having
successfully acquired an IP address (the 'inet addr') provided by our cable internet
service provider.</P
><P
> 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 <A
HREF="configuration.html#DEVICE-IFACE"
>Section 3.2</A
>. </P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="DEVICE-IFACE"
></A
>3.2. Grabbing A Specific Interface</H2
><P
> Let's say
we want to select a specific Ethernet interface (<EM
>ethX</EM
>) to be the
recipient of the DHCP cable internet service. If you run <B
CLASS="COMMAND"
>ifconfig</B
>
as root you get a list of open devices: </P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>eth0 Link encap:Ethernet
HWaddr 00:D0:09:DE:D4:6F
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 BROADCAST RUNNING
MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) Interrupt:12 Base address:0xc400</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
>lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX
packets:5168 errors:0 dropped:0 overruns:0 frame:0 TX packets:5168 errors:0
dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1695104
(1.6 MiB) TX bytes:1695104 (1.6 MiB)</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>...where eth0 is a standard NIC that we have preconfigured to
the IP address 192.168.1.1.</P
><P
> 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. </P
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="MANUAL"
></A
>3.2.1. Manually Assigning MAC to Interface Name</H3
><P
>Whatever distribution you use, you can always use the command line to designate an
Ethernet device (via the MAC) to be interface '<EM
>ethX</EM
>' 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: </P
><P
> <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
># ifconfig ethX hw ether 00:D0:09:DE:D4:6F up &#13;</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
>You can check if it worked by calling
<B
CLASS="COMMAND"
>ifconfig</B
> without options after your next reboot. See <B
CLASS="COMMAND"
>man
ifconfig</B
> for more options.</P
></DIV
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="AUTOCONFIG"
></A
>3.2.2. Automatic Configuration of Devices</H3
><P
> The
method for automatically assigning a particular interface name <EM
>ethX</EM
>,
to a specific hardware interface (Media Access Control address) differs by distribution.</P
><DIV
CLASS="SECT4"
><H4
CLASS="SECT4"
><A
NAME="DEB"
></A
>3.2.2.1. Debian</H4
><P
> If you are running a Debian system,
you can alter the <TT
CLASS="FILENAME"
>/etc/network/interfaces</TT
> file to look like
this:</P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8) # The
loopback interface auto lo iface lo inet loopback auto eth0 iface eth0 inet
static address 192.168.1.1 netmask 255.255.255.0 network 192.168.1.0 hwaddress
ether 00:D0:09:DE:D4:6F
auto eth1 iface eth1 inet dhcp hwaddress ether 00:04:BD:DE:42:0B</PRE
></FONT
></TD
></TR
></TABLE
></P
><P
> The <B
CLASS="COMMAND"
>auto eth0</B
> and <B
CLASS="COMMAND"
>auto eth1</B
>
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 <B
CLASS="COMMAND"
>/sbin/dhcpcd-bin
eth1</B
> 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
<TT
CLASS="FILENAME"
>/etc/init.d</TT
>. Then run <B
CLASS="COMMAND"
>update-rc.d</B
> as root with
the correct arguments (see <B
CLASS="COMMAND"
>man update-rc.d</B
>). </P
></DIV
><DIV
CLASS="SECT4"
><H4
CLASS="SECT4"
><A
NAME="RH"
></A
>3.2.2.2. Red Hat</H4
><P
> The file to
edit will of the form <TT
CLASS="FILENAME"
>ifcfg-ethX</TT
>, located in
<TT
CLASS="FILENAME"
>/etc/sysconfig/network-scripts/</TT
>. The contents are typically of
the form:</P
><P
> <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> DEVICE=eth1
# Device name. This is the interface your cable modem will use.
ONBOOT=yes
# load at boot BOOTPROTO=dhcp
# sets the device to receive an IP address from a DHCP server
HWADDR=00:04:BD:DE:42:0B
# the hardware MAC </PRE
></FONT
></TD
></TR
></TABLE
> </P
><P
> 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 <TT
CLASS="FILENAME"
>ifcfg-eth1</TT
>. You can then use <B
CLASS="COMMAND"
>ifconfig eth1
up</B
> from the command line to use it immediately. Upon reboot the correct
hardware settings should be loaded automatically.</P
></DIV
><DIV
CLASS="SECT4"
><H4
CLASS="SECT4"
><A
NAME="SLACKWARE"
></A
>3.2.2.3. Slackware</H4
><P
> Slackware 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. </P
></DIV
><DIV
CLASS="SECT4"
><H4
CLASS="SECT4"
><A
NAME="OTHERS"
></A
>3.2.2.4. Other Distributions</H4
><P
> Feel free to contribute if you have
distribution-specific information to add; see <A
HREF="intro.html#FEEDBACK"
>Section 1.5</A
>. Consult your
distribution documentation where appropriate.</P
></DIV
></DIV
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="USB"
></A
>3.3. Using the USB interface instead of an Ethernet card</H2
><DIV
CLASS="SECT3"
><H3
CLASS="SECT3"
><A
NAME="CDCE"
></A
>3.3.1. USB CDCEther</H3
><P
> If you wish to use the USB
interface to accept data you will need USB subsystem support in your kernel as
discussed in <A
HREF="prerequisites.html#NETWORKING"
>Section 2.1</A
>, 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 <A
HREF="http://www.linux-usb.org/"
TARGET="_top"
>Linux-USB project
site</A
>. </P
><P
>In addition the CDCEther (Communications Device Class Ethernet) protocol common to cable modems.</P
><P
>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 <B
CLASS="COMMAND"
>dmesg | less</B
> on the command line. Experienced users may want to take an easier route and check the configuration file for the currently running kernel in <TT
CLASS="FILENAME"
>/boot</TT
>, usually of the form <TT
CLASS="FILENAME"
>config-2.X.x</TT
>, which is a text file that can be grepped. On the command line, try <B
CLASS="COMMAND"
>grep -e</B
> followed by <B
CLASS="COMMAND"
>CONFIG_USB_CDCETHER</B
> in 2.4.x kernels or <B
CLASS="COMMAND"
>CONFIG_USB_ETH</B
> in 2.6.x kernels followed by the filename; you should see a '<EM
>=y</EM
> or <EM
>=m</EM
> at the end of this string for static or modular status, respectively.</P
><P
>The output of <B
CLASS="COMMAND"
>dmesg | less</B
> should reveal something similar to the following</P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> Mar 2 11:00:52 K7 kernel: CDCEther.c:
0.98.6 7 Jan 2002 Brad Hards and another
Mar 2 11:00:52 K7 kernel: usb.c: registered new driver CDCEther </PRE
></FONT
></TD
></TR
></TABLE
> </P
><P
>in the case of a statically compiled driver or a module loaded at boot.&#13;</P
><P
>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 <B
CLASS="COMMAND"
>lsmod</B
> as root. You should see the module <TT
CLASS="FILENAME"
>CDCEther</TT
> listed for 2.4.x kernels, or alternatively <TT
CLASS="FILENAME"
>usbnet</TT
> for 2.6.x kernels.</P
><P
>If you don't see it listed with <B
CLASS="COMMAND"
>lsmod</B
> try loading the module directly as root;
for kernel 2.4.x this would be of the form <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> # modprobe CDCEther </PRE
></FONT
></TD
></TR
></TABLE
>
whereas for 2.6.x the command would be <TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> # modprobe usbnet</PRE
></FONT
></TD
></TR
></TABLE
> </P
><P
>If all goes well you should see something like the following at the end of your system log
files (<TT
CLASS="FILENAME"
>/var/log/messages</TT
> or <TT
CLASS="FILENAME"
>/var/log/syslog</TT
>, you may need to be root to view these)
or at the end of <B
CLASS="COMMAND"
>dmesg | less</B
> from the command line:</P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> Mar 2 11:00:52 K7 kernel: CDCEther.c:
0.98.6 7 Jan 2002 Brad Hards and another
Mar 2 11:00:52 K7 kernel: usb.c: registered new driver CDCEther </PRE
></FONT
></TD
></TR
></TABLE
> </P
><P
> If all goes well you should see something like the following in your system log
files or at the end of <B
CLASS="COMMAND"
>dmesg</B
>: &#13;</P
><P
><TABLE
BORDER="1"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="SCREEN"
> Mar 2 11:00:52 K7 kernel: CDCEther.c:
0.98.6 7 Jan 2002 Brad Hards and another
Mar 2 11:00:52 K7 kernel: usb.c: registered new driver CDCEther </PRE
></FONT
></TD
></TR
></TABLE
> </P
><P
> 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 <A
HREF="http://www.tldp.org/HOWTO/Kernel-HOWTO.html"
TARGET="_top"
>the
Kernel-HOWTO</A
>. The options required to get USB interface support working on this
device have been addressed in <A
HREF="prerequisites.html#NETWORKING"
>Section 2.1</A
>. </P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="prerequisites.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="hardware.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Prerequisites</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Notes on Specific Hardware</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>