Setup internet on Linux using a DSL router

I am trying to setup my Red Hat Linux 9.0 box to connect to my DSL router.
I did the following , connected the Linux box to my router using the CAT 5 cable.
I ran netconfig on Linux and first tried to get IP automatically using DHCP , when i restart the machine (or do : service network start). I get the error : determining ip address for eth0 failed   no link present ...check cable.
I then tried manually setting ip address....then i dont get any errors , but i cant ping the router or any other machine on the network. But i can ping the IP address i just assigned myself.

I have no clue what to do next... please help
rahulkothariAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shivsaCommented:
have u installed DSL router driver for linux on your linux box.
0
shivsaCommented:
did u try enabling the link.
---------------------------
ifup eth0 down
ifup eth0 up
0
rahulkothariAuthor Commented:
why do i need DSL router driver ??
DSL router is already being used by two other machines , when i want to connect a Windows Machine...i just connect the cable (and do automatically get IP) and things work fine.

I am sure i dont need a driver to setup internet on linux , when the DSL router is already setup and in place.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rahulkothariAuthor Commented:
i did :
ifup eth0 down
ifup eth0 up


didnt help
0
shivsaCommented:
Above should refresh your TCP/IP properties, additionally u may need to create file named dhcpd.leases in /etc directory.

1.set up the default route through your eth0 interface with (need root permissions)
     route del default
     route add default eth0
try ping and see if it works in not then

2. check your  /etc/sysconfig/network
NETWORKING=yes               <--- u need this
HOSTNAME=your_machine_hostname    <--- thats ur machine name
GATEWAYDEV=eth0             <--- your 1st ethernet
device
GATEWAY=192.168.0.1         <--- that's the routing
0
shivsaCommented:
i got confused with DSL modem for driver issues, forget about that.
0
shivsaCommented:
u said u connect your windows machine and it works fine then good try these. could u check these values.

in /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0                                    
BOOTPROTO=none                            
BROADCAST=192.168.0.255              <---- 1st & 2nd number got to match with the gateway keep the 0 & 255 alone u can check this value from windows.
NETMASK=255.255.255.0                   <---- same as your windows machine
IPADDR=
USERCTL=NO                                      
ONBOOT=yes                                      
0
shivsaCommented:
also check your resolv.conf file has DNS server, u can check this server from your windows machine.
0
rahulkothariAuthor Commented:
i did this....

NETWORKING=yes              
HOSTNAME=lucky  
GATEWAYDEV=eth0            
device
GATEWAY=192.168.1.1        

now i did : service network start

tried to ping my router...didnt work

0
shivsaCommented:
Redhat 9 should use ethadmin, could y try setting up again with this tool.
0
rahulkothariAuthor Commented:
where is resolv.conf , i did cat /etc/resolv.conf.....it only prints:  search
0
rahulkothariAuthor Commented:
i searched on google , ethadmin + Red Hat :)
no results....i dont think there is sich thing
0
shivsaCommented:
or try this
startup linuxconf as root and go into
config->networking->client tasks->basic host information
make sure it's enabled and DHCP is checked.

for more information check this link.
http://thecity.sfsu.edu/LDP/HOWTO/mini/DHCP.html


0
rahulkothariAuthor Commented:
i dont have linuxconf :(
0
rahulkothariAuthor Commented:
0
shivsaCommented:
Check if firewall is off.... try:
#service iptables stop
#ifup eth0
If interface brings up -> disable firewall at all or add rule for dhcp

1. In /etc/sysconfig/network remove the HOSTNAME and GATEWAY entries.
2. In /etc/sysconfig/network-scripts/ifcfg-eth0  remove the IPADDR, NETMASK, NETWORK, and BROADCAST entries. leave  DEVICE and ONBOOT as is.  change the BOOTPROTO line to BOOTPROTO=dhcp
3. create a /etc/resolv.conf file
and put dns server entry there.
and restart your network.

sometime DHCP server does not DNS entry properly and u can get out, so u have to create it manully.
0
rahulkothariAuthor Commented:
what should be my DNS entry ?? if my ip is 192.168.1.103 and the router's ip is 192.168.1.1
0
shivsaCommented:
u can get this value from your working windows system and put that value here.
ipconfig /all
0
rahulkothariAuthor Commented:
now i cannot start the network
0
shivsaCommented:
what is error coming.
0
shivsaCommented:
BTW what i meant in
In /etc/sysconfig/network remove the HOSTNAME and GATEWAY entries.
2. In /etc/sysconfig/network-scripts/ifcfg-eth0  remove the IPADDR, NETMASK, NETWORK, and BROADCAST entries. leave  DEVICE and ONBOOT as is.  change the BOOTPROTO line to BOOTPROTO=dhcp

remove the values fields not the full line. u have to have those line to work.
0
rahulkothariAuthor Commented:
i cannot bring up eth0.....it sayd some problem with dhcpclient
0
rahulkothariAuthor Commented:
it gives error in eth0.....sbin/dhclient-script : device command not found
0
shivsaCommented:
do u have dhcpd running.
also do u have dhcp client software on your system.
0
shivsaCommented:
ps -aef | grep dhcp does it give u anything.
0
rahulkothariAuthor Commented:
i did a grep..the process is running.....
0
shivsaCommented:
/sbin/dhclient-script is main script and it will generate all the dhcp config files for u, even resolv.conf also generated by it. thats why u did not have resolv.conf.

find / -name "*dhcp* -print

to look for this script.  and if u found on some other place other then /sbin, then create a link to it from /sbin
0
rahulkothariAuthor Commented:
i dont have any dhcp scripts inside sbin , whats the exact name of the file to look for...
i think i have to create this myself.....what contents do i need to put in
0
shivsaCommented:
I see the problem u have put device value in /etc/sysconfig/network, my bad typing mistake.
u have everything u need, it is failed to find command device which should not be there at first place.
sorry about that.

--------------------------
ok then just roll back.
-------------------------------
change resolv.conf to
nameserver         DNS_ip_address.
--------------------------------

/etc/sysconfig/network would look like:
NETWORKING=yes
HOSTNAME=
GATEWAYDEV=eth0            
GATEWAY=
--------------------------------
0
rahulkothariAuthor Commented:
before i had inside resolv.conf

nameserver=151.198.0.39

i changed it to
nameserver DNS_ip_address
 
?? is that correct
0
rahulkothariAuthor Commented:
and also :
why is HOSTNAME and GATEWAY empty ??
0
shivsaCommented:
yes. and use a tab netween nameserver and ipaddress.
also
/etc/sysconfig/network-scripts/ifcfg-eth0 should like.
--------------
DEVICE=eth0                                    
BOOTPROTO=dhcp                          
BROADCAST=
NETMASK=
IPADDR=
USERCTL=NO                                      
ONBOOT=yes      
-------------------------
0
shivsaCommented:
gateway is provided by the dhcp server, if it detect it put the value there, if not then we can put by outselves also, but i am leaving for the fresh connection to start with.
dhcp server keep getting changes and so the gateway server. dhcp take care of these functionality.

also hostname is also proviced by dhcp most of the time, if u want to have static name, u have to have some rule to fetch your hostname to dhcp. ( this is my solaris knowledge !). but may be true here too.
0
rahulkothariAuthor Commented:
i get the error :
Determining IP information for eth0.....failed
0
rahulkothariAuthor Commented:
and when i try to ping my router or my own ip = 192.168.1.103 , i get the error : network is unreachable
0
shivsaCommented:
ok mv the resolv.conf to resolv.conf.backup
and reboot the linux.
0
rahulkothariAuthor Commented:
ok..i am rebooting now
0
rahulkothariAuthor Commented:
i rebooted.....there is no /etc/resolv.conf anymore....i tried to start the network service again
and when it was Bringing up the interface eth0 ...it gave the same error : Determining IP information for eth0.....failed
0
shivsaCommented:
ok, now u are machine is in dhcp environment. but can not find ip address for itself.
may be route/gateway and dns problem.
------------------------------------------------
now u can do what i said before.
#service iptables stop
#ifup eth0      
does not work.
--------------------
# route del default
# route add default eth0
#ifup eth0
does not work
-------------------
/etc/sysconfig/network would look like:
NETWORKING=yes
HOSTNAME=
GATEWAYDEV=eth0            
GATEWAY=192.168.1.1
# route del default
# route add default eth0
#ifup eth0
----------------------------
0
shivsaCommented:
also check your /var/adm/messages file abd post any messages/error related to DHCP discover or something.
0
rahulkothariAuthor Commented:
i changed my /etc/sysconfig/network
to :

NETWORKING=yes
HOSTNAME=
GATEWAYDEV=eth0            
GATEWAY=192.168.1.1

then i typed, on the prompt:
# route del default
# route add default eth0
#ifup eth0

i get the same error : Determining IP information for eth0.....failed
0
shivsaCommented:
only one option left.

mkdir /etc/dhcpc
Make a link from /etc/dhcpc/resolv.conf to /etc/resolv.conf
ln -s /etc/dhcpc/resolv.conf /etc/resolv.conf
restart network.
if it fails.

move /etc/resolv.conf.back to /etc/resolv.conf
restart network
0
shivsaCommented:
also u can add your ethernet mac value to
/etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR=
0
rahulkothariAuthor Commented:
doesnt work :(...same problem
0
shivsaCommented:
there is no software problem looks here.
may be hardware, will u change the cable and replace it with what u r using on windows system.
0
rahulkothariAuthor Commented:
checked the wire...works fine
0
shivsaCommented:
u rebooted so firewall must have come again.
 Check if firewall is off.... try:
#service iptables stop
#fup eth0 down
#ifup eth0 up
restart network


0
shivsaCommented:
also if your hardware is good and all, as u say.
then you can try static config.
----------------------------------
/etc/sysconfig/network:
NETWORKING=yes
HOSTNAME=lucky
GATEWAYDEV=eth0            
GATEWAY=192.168.1.1
-------------------------------
/etc/sysconfig/network-scripts/ifcfg-eth0 should like.
--------------
DEVICE=eth0                                    
BOOTPROTO=dhcp                          
BROADCAST=                          
NETMASK=                                  <-- get this value from windows.
IPADDR=192.168.1.103                
USERCTL=NO                                      
ONBOOT=yes      
-------------------------
ifconfig inet 192.168.1.103 netmask 255.255.255.0 broadcast 192.168.1.1
ifup eth0 up
0
stevenlewisCommented:
swap cables with a know good one, and  then try it (sounds like a bad cable)
0
stevenlewisCommented:
and plug into a know good port on the router
0
rahulkothariAuthor Commented:
finally some good news , i can ping all other machines on the network...can also ping the router. But still internet doesnt work...cant ping www.yahoo.com either
0
shivsaCommented:
good, so now it is either route problem or DNS problem.
what is output of
route -n
0
rahulkothariAuthor Commented:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0

thats the result of route -n
0
shivsaCommented:
it looks ok,
could u check file
/etc/sysconfig/networking/profiles/default/resolv.conf
and its content, and compare it with /etc/resolv.conf file.
also check netstat -rn output.
0
shivsaCommented:
route add default gw 192.168.1.1

Also You can see what data was offered by the DHCP negotiation in the dhcpcd info file (usually /etc/dhcpc/dhcpcd-eth0.info)
0
shivsaCommented:
also check the output of traceroute 216.239.53.99
0
rahulkothariAuthor Commented:
route add default gw 192.168.1.1
results in the message : file exists

traceroute 216.239.53.99
results in : Host unknown
0
shivsaCommented:
route is not working.
# route del default
# route add default  gw 192.168.1.1
#ifup eth0 up
and also i asked for other output  in above comments.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rahulkothariAuthor Commented:
Shiva.....works fine now.
I just added a DNS entry.....

Thanx for all ur help
0
shivsaCommented:
Youe welcome.
glad to know that things worked out for u.
now i can start on your next question i just saw.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Distributions

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.