LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-29-2004, 08:20 PM   #1
nasirjones
LQ Newbie
 
Registered: Dec 2004
Distribution: arch, ubuntu(headless), redhat
Posts: 14

Rep: Reputation: 0
networking problemz


I have a redhat linux 9 comp with one NIC and 2 xp computers, all are connected to a linksys wired router, I setup dhcp on the linux box and the 2 client computers get the address but wont connect to the internet, someone told me maybe I need two NICs in the redhat box is that true? Can anyone tell me y the client machines dont connect to the internet? I forwarded the ports on the router for the addresses even but that doesnt help.

thanx
 
Old 12-29-2004, 08:22 PM   #2
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
do you have a default route set to the router's IP?

Is the RedHat box handing out IP addresses that are on the same network as the router?
 
Old 12-29-2004, 08:35 PM   #3
nasirjones
LQ Newbie
 
Registered: Dec 2004
Distribution: arch, ubuntu(headless), redhat
Posts: 14

Original Poster
Rep: Reputation: 0
hmmmmm not sure what u mean by default route.....ya the addresses are all on the correct subnet.
 
Old 12-29-2004, 08:47 PM   #4
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
You must tell the machine where network packets are allowed to go. Type route at the command line (as root) and you will see networks that packets are allowed to go to. You need to set the default to let the machine know that it can take network packets and send them to that other machine on the net.

You can set the default route at the command line with:
route add default gw xxx.xxx.xxx.xxx
sub the IP of the machine that connects to the internet (probably your router if I remember correctly). Thjis will be good until you reboot. If that works out correctly, then just ask and we can get the default route to be good everytime you reboot the machine.
 
Old 12-29-2004, 09:06 PM   #5
nasirjones
LQ Newbie
 
Registered: Dec 2004
Distribution: arch, ubuntu(headless), redhat
Posts: 14

Original Poster
Rep: Reputation: 0
yup that worked....thanx alot...

so how do i get it to initiate the route add default gw command when it boots up?
 
Old 12-29-2004, 09:30 PM   #6
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
What distro are you using?

In redhat, you can make an entry in the file called
/etc/rc.d/rc.local
That is read after the rc scripts are run.

In suse, you can put that in the /etc/rc.d/boot.local file.


On any distro, you can create a script, make it executable, and stick it in the runlevel directory.

Let's say you are coming up in run level 5 (Xwindows)
simply
echo "route add default gw 192.168.0.1" >/etc/rc.d/rc5.d/S99myroute

chmod +x /etc/rc.d/rc5.d/S99myroute


Your rc5.d dir may be right under /etc, on redhat it is under /etc/rc.d
 
Old 12-29-2004, 09:55 PM   #7
nasirjones
LQ Newbie
 
Registered: Dec 2004
Distribution: arch, ubuntu(headless), redhat
Posts: 14

Original Poster
Rep: Reputation: 0
thanx man...

so if I put the s99myroute file in rc5.d it will start that script on boot?
 
Old 12-29-2004, 10:20 PM   #8
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
Ues, assuming you made the script executable

chmod +x /etc/rc.d/rc5.d/S99myroute and that you are coming up in run level 5.

Or, since you are using RedHat, you can enter that route command in /etc/rc.d/rc.local
and it won't matter what runlevel you boot into.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
networking mifan Mandriva 3 08-18-2005 08:52 AM
new to networking essoft478 Linux - Networking 2 12-18-2004 04:20 PM
networking thornton Linux - Networking 1 07-10-2004 01:00 AM
Random Networking to Non-Networking o-o Ne0BDP Slackware 3 07-08-2004 01:18 AM
2.6.0 no networking mint567 Slackware 2 12-24-2003 12:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration