• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Howto configure cable-LAN in Red Hat 8.0?

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Lancelot

Member
Joined
Feb 12, 2001
Location
the Netherlands
My NIC is detected, but it won't be enabled for some reason. Under Windows all I need to do is set my computer name and I'm online. How the heck is this done under Linux?
 

naif

Member
Joined
Feb 17, 2002
What type of a NIC is it? A cable modem or an ethernet card. You can configure an ethernet card as follows

ifconfig ethn xx.xx.xx.xx # n represents the ethernet card, and xx.xx.xx.xx is the IP address you want to assign to that ethernet
card

an example would be

ifconfig eth0 10.0.0.1 # This will configure the first ethernet card on your system, and assign it the ip address 10.0.0.1

But I guess you might be using a cable modem, but you refered to LAN in the subject, so I am thinking it might be an Ethernet card :)
 
OP
Lancelot

Lancelot

Member
Joined
Feb 12, 2001
Location
the Netherlands
Yeah sorry, it's a 10Mbit ISA Ethernet card connected to a cablemodem. I assigned the correct IRQ to it and it is recognized, but I have no clue as how to get online now. Under Windows all it takes is setting the computer name my ISP gave me and 'automatic detect settings', and that's it. I'm quite new to Linux...
 

naif

Member
Joined
Feb 17, 2002
Can you please show the details your ISP gave you, because that might give alot of info about how to get it configured.
 
OP
Lancelot

Lancelot

Member
Joined
Feb 12, 2001
Location
the Netherlands
I have to set the computer name to "xxxxx-a" and it has to use DHCP and use a dynamic IP-address and all. So where do I set/use that computer name in Linux?
 

naif

Member
Joined
Feb 17, 2002
Hmm, I never played/experimented with these sort of connections, specially those involving the use of DCHP. Anyways, what distrobution are you using. Try the following rc script from Slackware, I think it should help you configure it. But even I am not sure if it would work, anyways, give it a try ;)

Edit the lines from the place I marked # *** EDIT FROM HERE and stop at # *** END EDIT FROM HERE

Try everything you can with them. If your host assigns you a dynamic ip address, I dont know what you should put inside the IPADDR variable but like I said, try everything. Save this file as anything you want and give it execute permissions and run it, or run it using bash/sh.

#! /bin/sh
# /etc/rc.d/rc.inet1
# This script starts up the base networking system.
#
# Version:
# @(#)/etc/rc.d/rc.inet1 8.1 Tue May 28 15:27:39 PDT 2002 (pjv)

# *** EDIT FROM HERE

# Edit these values to set up your first Ethernet card (eth0):
IPADDR="127.0.0.1" # REPLACE with YOUR IP address!
NETMASK="255.255.255.0" # REPLACE with YOUR netmask!
# Or, uncomment the following lines to set up eth0 using DHCP:
USE_DHCP=yes
# If your provider requires a DHCP hostname, uncomment and edit below:
DHCP_HOSTNAME="CCHOSTNUM-A"
# Edit the next line to point to your gateway:
GATEWAY="" # REPLACE with YOUR gateway!

# *** END EDIT FROM HERE

# Edit these values to set up your second Ethernet card (eth1),
# if you have one. Otherwise leave it configured to 127.0.0.1,
# or comment it out, and it will be ignored at boot.
#IPADDR2="127.0.0.1" # REPLACE with YOUR IP address!
#NETMASK2="255.255.255.0" # REPLACE with YOUR netmask!
# Or, uncomment the following lines to set up eth1 using DHCP:
#USE_DHCP2=yes
# If your provider requires a DHCP hostname, uncomment and edit below:
#DHCP_HOSTNAME2="CCHOSTNUM-A"

# You shouldn't need to edit anything below here.

# Set up the loopback interface:
/sbin/ifconfig lo 127.0.0.1
/sbin/route add -net 127.0.0.0 netmask 255.0.0.0 lo

# Set up the eth0 interface:
if [ "$USE_DHCP" = "yes" ]; then # use DHCP to set everything up:
echo "Attempting to configure eth0 by contacting a DHCP server..."
# Add the -h option to the DHCP hostname:
if [ ! "$DHCP_HOSTNAME" = "" ]; then
DHCP_HOSTNAME="-h $DHCP_HOSTNAME"
fi
/sbin/dhcpcd -t 10 ${DHCP_HOSTNAME} -d eth0
elif [ ! "$IPADDR" = "127.0.0.1" -a ! "$IPADDR" = "" ]; then # set up IP statically:
# Determine broadcast and network addresses from the IP address and netmask:
BROADCAST=`/bin/ipmask $NETMASK $IPADDR | cut -f 1 -d ' '`
NETWORK=`/bin/ipmask $NETMASK $IPADDR | cut -f 2 -d ' '`
# Set up the ethernet card:
echo "Configuring eth0:"
echo "ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}"
/sbin/ifconfig eth0 ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK}
# If that didn't succeed, give the system administrator some hints:
if [ ! $? = 0 ]; then
echo "Your eth0 card was not initialized properly. Here are some reasons why this"
echo "may have happened, and the solutions:"
echo "1. Your kernel does not contain support for your card. Including all the"
echo " network drivers in a Linux kernel can make it too large to even boot, and"
echo " sometimes including extra drivers can cause system hangs. To support your"
echo " ethernet, either edit /etc/rc.d/rc.modules to load the support at boot time,"
echo " or compile and install a kernel that contains support."
echo "2. You don't have an ethernet card, in which case you should run netconfig"
echo " and configure your machine for loopback. (Unless you don't mind seeing this"
echo " error...)"
fi
fi # set up eth0

# Set up the eth1 interface:
if [ "$USE_DHCP2" = "yes" ]; then # use DHCP to set everything up:
echo "Attempting to configure eth1 by contacting a DHCP server..."
# Add the -h option to the DHCP hostname:
if [ ! "$DHCP_HOSTNAME2" = "" ]; then
DHCP_HOSTNAME2="-h $DHCP_HOSTNAME2"
fi
/sbin/dhcpcd -t 10 ${DHCP_HOSTNAME2} -d eth1
elif [ ! "$IPADDR2" = "127.0.0.1" -a ! "$IPADDR2" = "" ]; then # set up IP statically:
# Determine broadcast and network addresses from the IP address and netmask:
BROADCAST2=`/bin/ipmask $NETMASK2 $IPADDR2 | cut -f 1 -d ' '`
NETWORK2=`/bin/ipmask $NETMASK2 $IPADDR2 | cut -f 2 -d ' '`
# Set up the ethernet card:
echo "Configuring eth1:"
echo "ifconfig eth1 ${IPADDR2} broadcast ${BROADCAST2} netmask ${NETMASK2}"
/sbin/ifconfig eth1 ${IPADDR2} broadcast ${BROADCAST2} netmask ${NETMASK2}
# If that didn't succeed, give the system administrator some hints:
if [ ! $? = 0 ]; then
echo "Your eth1 card was not initialized properly. Here are some reasons why this"
echo "may have happened, and the solutions:"
echo "1. Your kernel does not contain support for your card. Including all the"
echo " network drivers in a Linux kernel can make it too large to even boot, and"
echo " sometimes including extra drivers can cause system hangs. To support your"
echo " ethernet, either edit /etc/rc.d/rc.modules to load the support at boot time,"
echo " or compile and install a kernel that contains support."
echo "2. You don't have an ethernet card, in which case you should fix"
echo " /etc/rc.d/rc.inet1 to stop trying to configure eth1. (Unless you don't mind"
echo " seeing this error...)"
fi
fi # set up eth1

# Set up the gateway:
if [ ! "$GATEWAY" = "127.0.0.1" -a ! "$GATEWAY" = "" ]; then
/sbin/route add default gw ${GATEWAY} metric 1
fi

# End of /etc/rc.d/rc.inet1
 

the_poche

Member
Joined
Apr 27, 2002
Location
Canada
I had a problem like this , I think :) and couldnt get internet connection to work , and in the end , I found out that in the BIOS I had the set the "Plug and Play OS" or something similar, to no or off. You might want to try this and see what happens.
 

kevmarks

Member
Joined
Mar 3, 2002
Location
Chicago
you need to find out what protocol your ISP is using. A very common one is PPPoE. Take a look at roaring pengiun or something like that.

I don't have much experience with cable modems. Only DSL, which mostly uses PPPoE. I imagine cable will be the same.

I have a linksys which logs in for me and I just have to give me machines a static address. A linksys makes it oh so easy!
 
OP
Lancelot

Lancelot

Member
Joined
Feb 12, 2001
Location
the Netherlands
ok Thanx guys, I copied and pasted all your advice (naif: you're crazy man! but thanks) and I'll give it a try later this week!
 

snowmobile74

Member
Joined
Oct 25, 2001
Location
Iowa
um yea something a lot easier is just type netconfig at the console its much easier than editing the file but this will only work you installed gnome but you dont have to be runing it