TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG:7057] Cable modem
Rodney wrote:
>
> I was wondering if anyone knows where to find info on how to get RH6.0
> Linux to use a cable modem (MediaOne)..
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tclug-list-unsubscribe@mn-linux.org
> For additional commands, e-mail: tclug-list-help@mn-linux.org
>
Well, first you need to configure networking to talk to the cable modem
as your "default gateway". I used control-panel's "networking" stuff
to do this.
Especially helpful for this is the "Cable-modem mini HOWTO" and the DHCP
stuff (If you're running RedHat's 6.0, check
file:/usr/doc/HOWTO/other-formats/html/HOWTO-INDEX-3.html,
this file will contain pointers to these HOWTOs).
Once you've got networking configured on your linux box to talk to the
cable modem, then there's two ways to actually initiate the connection.
1- Recommended (by MediaOne) -- very slow:
A-drive Netscape to http://192.168.100.1,
B-fill in the boxes with your "Username" and "Password"
(remembering that your username ends with "@m1"), and
C-then hit the "Connect Now" button.
DO NOT depress the "Save Password" button... my understanding
is that this puts the password somewhere visible to the outside
world.
2- Slightly faster (does NOT require firing up a browser, but _DOES_
require an external Surfboard model SB1200 cable modem. If you
haven't got an external SB1200, this probably won't work.):
A- Unpack the shar file attached in an otherwise empty directory,
C- Edit "s1.on" changing "USERNAME" and "PASSWORD" (remembering to
keep the "@m1" bit as part of your username),
B- Run "make", and
D- Then execute "s1.on" to log in & "s1.off" to log off.
(I found the s1.c program back when I was digging around on the WWW
for cable modem help myself)
As ISPs go, MediaOne sucks (See recent threads in Usenet's Mn.general with
MediaOne in the "Subject:" field for further info).
Hope this helps,
-S
============================================================================
/| | |
\'o.O' | He's dead Jim. You get his | Steve Siegfried
=(___)= | phaser, I'll get his wallet. | sos@skypoint.com
U | |
============================================================================
--------------Cut after this line and feed the bottom to /bin/sh------------
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 1999-07-20 11:05 CDT by <root@sos>.
# Source directory was `/home/sos/src/cable.modem'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 823 -rw-r--r-- Makefile
# 2235 -rw-r--r-- s1.c
# 117 -rwx------ s1.on
# 104 -rwx------ s1.off
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
shar_touch=touch
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 1231235999 $$.touch
#
if mkdir _sh04687; then
$echo 'x -' 'creating lock directory'
else
$echo 'failed to create lock directory'
exit 1
fi
# ============= Makefile ==============
if test -f 'Makefile' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'Makefile' '(file already exists)'
else
$echo 'x -' extracting 'Makefile' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'Makefile' &&
# Makefile for s1
# RCSID $Id: Makefile,v 1.2 1999/06/05 18:44:12 sos Exp sos $
X
SHELL=/bin/sh
MACH=`hostname`
OSTYPE=`uname`
X
all: s1.c s1.on s1.off s1
X
s1: s1.o
X gcc -ansi s1.o -o s1
X
clean:
X rm -f *.o s1 core
X
linstall: s1 s1.on s1.off
X -@rm -f $(HOME)/bin/s1
X -@rm -f $(HOME)/bin/s1.on
X -@rm -f $(HOME)/bin/s1.off
X -@cp s1 $(HOME)/bin/.
X -@cp s1.on $(HOME)/bin/.
X -@cp s1.off $(HOME)/bin/.
X -@/bin/ls -l $(HOME)/bin/s1*
X touch linstall
X
install: s1 s1.on s1.off
X install -m 700 -o root -g daemon s1 /bin/s1
X install -m 700 -o root -g daemon s1.on /bin/s1.on
X install -m 700 -o root -g daemon s1.off /bin/s1.off
X
shar: Makefile s1.c s1.on s1.off
X shar Makefile s1.c s1.on s1.off > S1.shar
X touch shar
X
rcsdiff: Makefile s1.c s1.on s1.off
X -@rcsdiff Makefile
X -@rcsdiff s1.c
X -@rcsdiff s1.on
X -@rcsdiff s1.off
X
SHAR_EOF
$shar_touch -am 0720110099 'Makefile' &&
chmod 0644 'Makefile' ||
$echo 'restore of' 'Makefile' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'Makefile:' 'MD5 check failed'
723e3963bdf50b213b3aa3b3808e5a01 Makefile
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Makefile'`"
test 823 -eq "$shar_count" ||
$echo 'Makefile:' 'original size' '823,' 'current size' "$shar_count!"
fi
fi
# ============= s1.c ==============
if test -f 's1.c' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 's1.c' '(file already exists)'
else
$echo 'x -' extracting 's1.c' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 's1.c' &&
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
X
X
int
main (int argc, char **argv)
{
X int s;
X int fw_rc,cnt;
X struct sockaddr_in sin;
X struct hostent *hp;
X unsigned long ip;
X char in[2048];
X char out[2048];
X char login[128];
X
X /* Check command line */
X if (((argc == 3) && (argv[1][0] != 'd'))
X || ((argc == 5) && (argv[1][0] != 'c'))
X || ((argc != 3) && (argc != 5)))
X {
X printf ("Usage: %s connect sb.ip.address username password\n",
X argv[0]);
X printf (" or: %s disconnect sb.ip.address\n", argv[0]);
X printf ("\nReport bugs to Ryan Drake: stiletto@mediaone.net\n");
X exit (EXIT_SUCCESS);
X }
X
retry:
X /* Create socket */
X if ((s = socket (AF_INET, SOCK_STREAM, 0)) == -1)
X {
X perror (argv[0]);
X exit (EXIT_FAILURE);
X }
X
X /* Lookup host */
X if ((hp = gethostbyname (argv[2])) == NULL)
X {
X perror (argv[0]);
X exit (EXIT_FAILURE);
X }
X memcpy (&ip, hp->h_addr, hp->h_length);
X
X /* Connect */
X memset (&sin, 0, sizeof (sin));
X sin.sin_family = AF_INET;
X sin.sin_port = htons (80);
X sin.sin_addr.s_addr = ip;
X if (connect (s, (struct sockaddr *) &sin, sizeof (sin)) < 0)
X {
X perror (argv[0]);
X exit (EXIT_FAILURE);
X }
X
X if (argv[1][0] == 'c')
X {
X /* Connect to the internet */
X sprintf (login,
X "USERNAME=%s&PASSWORD=%s&SAVE_PASSWORD_CHK=off",
X argv[3], argv[4]);
X
X sprintf (out,
X "POST /connecting.html HTTP/1.0\r\nContent-type:\napplication/x-www-form-urlencoded\r\nContent-length: %i\r\n\r\n%s\r\n",
X strlen (login), login);
X
X send (s, out, strlen (out), 0);
X while ((cnt=recv (s, in, 2047, 0)) > 0)
X {
X fw_rc = fwrite(&in[0],1,cnt,stdout);
X }
X
X close (s);
X
X if (strncmp (&(in[138]), "You are connected", 17))
X exit (EXIT_FAILURE);
X }
X else
X {
X /* Disconnect from the internet */
X sprintf (out, "POST / HTTP/1.0\r\nContent-type:\napplication/x-www-form-urlencoded\r\nContent-length:\n6\r\n\r\nYOU=++\r\n");
X send (s, out, strlen (out), 0);
X
X while (recv (s, in, 2047, 0) > 0)
X ;
X
X close (s);
X }
X
X exit (EXIT_SUCCESS);
}
SHAR_EOF
$shar_touch -am 0620034799 's1.c' &&
chmod 0644 's1.c' ||
$echo 'restore of' 's1.c' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 's1.c:' 'MD5 check failed'
dea3b67d56bafb8869bfb268bc8c67df s1.c
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 's1.c'`"
test 2235 -eq "$shar_count" ||
$echo 's1.c:' 'original size' '2235,' 'current size' "$shar_count!"
fi
fi
# ============= s1.on ==============
if test -f 's1.on' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 's1.on' '(file already exists)'
else
$echo 'x -' extracting 's1.on' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 's1.on' &&
#!/bin/ksh
if s1 connect 192.168.100.1 USERNAME@m1 PASSWORD
then echo "Connected."
else echo "Failed to connect."
fi
SHAR_EOF
$shar_touch -am 0720110499 's1.on' &&
chmod 0700 's1.on' ||
$echo 'restore of' 's1.on' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 's1.on:' 'MD5 check failed'
da689e47a43db0d572d9e5a9257750bb s1.on
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 's1.on'`"
test 117 -eq "$shar_count" ||
$echo 's1.on:' 'original size' '117,' 'current size' "$shar_count!"
fi
fi
# ============= s1.off ==============
if test -f 's1.off' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 's1.off' '(file already exists)'
else
$echo 'x -' extracting 's1.off' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 's1.off' &&
#!/bin/ksh
if s1 disconnet 192.168.100.1
then echo "Disconnected."
else echo "Failed to disconnect."
fi
SHAR_EOF
$shar_touch -am 0720110199 's1.off' &&
chmod 0700 's1.off' ||
$echo 'restore of' 's1.off' 'failed'
if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
&& ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 's1.off:' 'MD5 check failed'
895ccb98c1e2dd620179a40797b54661 s1.off
SHAR_EOF
else
shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 's1.off'`"
test 104 -eq "$shar_count" ||
$echo 's1.off:' 'original size' '104,' 'current size' "$shar_count!"
fi
fi
rm -fr _sh04687
exit 0