LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 12-29-2004, 07:52 PM   #1
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Rep: Reputation: 15
Connecting to the net...


I just installed 10.0 and I want to connect to the internet. Here's my setup...
I've my highspeed internet going straight into an XP machine, then from that machine going into a switch, then to my linux machine.
How would I setup the internet on the linux machine, anyone familiar with this?
 
Old 12-29-2004, 08:28 PM   #2
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
first, on the xp box, you need to share that internet connection. That will probably set the xp box's IP to something like 192.168.0.1. (maybe different)
Then on the linux box, ya need the IP to be on the same net as that shared connection. Also you need to set the default route to that of the xp box.

route add default gw 192.168.0.1

Do not forget to make an entry in the /etc/resolv.conf to point to a valid nameserver.

nameserver 207.217.120.83

or whatever.
You can probably set it to the xp box's IP as well.

nameserver 192.168.0.1
 
Old 12-29-2004, 08:53 PM   #3
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
Okay, the XP box has a couple other computers connected to it, all using XP. So yes, it's sharing.

As for the Linux box... (keep in mind i'm very new to linux)

Is this a command line?
route add default gw 192.168.0.1


And in the etc/resolv.conf do i just add this line to it at the end?
nameserver 192.168.0.1


(i'm hoping that nameserver will work, I dont know what else I could use *shrugs*)
 
Old 12-29-2004, 09:03 PM   #4
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
yes, open a terminal and type that
route add default gw xxx.xxx.xxx.xxx

Sub the ip of that xp box for the xxx part.

You can do this from gui based dialogs too,
 
Old 12-29-2004, 09:14 PM   #5
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
Well I know the IPs on the other computers are 192.168.0.xx (xx being a random number)

I tried running that line you gave me but it says command not found. Keep in mind that I'm new to this, if I could just run commands that would be great... The GUIs are extremely confusing.

What 'bout that file, should I just add that nameserver line at the bottom?
 
Old 12-29-2004, 09:22 PM   #6
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
The route command must be run by root.

It is in the /sbin directory, so you can issue

/sbin/route add default gw 192.168.0.1

You can have 3 nameservers listed in the /etc/resolv.conf file.
 
Old 12-29-2004, 10:23 PM   #7
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
Hmmm, I'm starting to make my way around Linux nicely, but came across a little problem.
Here's what my resolv.conf looks like now...
search 255.255.255
# search homeland.net

nameserver 192.168.0.1

# ppp temp entry


The nameserver line did have 127.0.0.0 next to it, but I changed that number to the 192 because it looked familiar from my XP machine (which I'm typing from right now).
Then after changing that successfully I typed in what you said in the sbin and this is the message I got
Network is unreachable.
I know it is because when I swap out HDs on this machine to my XP HD (the machine has 2 HDs, Linux and XP but both not connected at same time) it performs fine on the network.
I do feel we're gettin' close here tho....
 
Old 12-29-2004, 10:26 PM   #8
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
Wait... This time I put both lines in the resolve.conf file like this...


search 255.255.255
# search homeland.net
nameserver 127.0.0.0
nameserver 192.168.0.1

# ppp temp entry



I ran the route command and it just went to the next line waiting for the next command, like it did something but it had no output. I tried the route command with both numbers it has listed in the .conf.

I tried my internet, nothing still.
 
Old 12-29-2004, 10:30 PM   #9
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
That is pretty strange that nameserver 25.255.255 is in there.. That is part of the netmask.

You can have 3 nameserver resolvers lited. They will be checked in the order they are listed.

127.0.0.1 is localhost. everything at some point or other goes through that.

It would not be wrong to have this

nameserver 192.168.0.1
nameserver 127.0.0.1
nameserver 207.217.120.83

The line that reads search simply defines that if you ping or try to go to a host machine with just the hostname part, it will automatically tack on the domain part.

In other words, lets say I have my domain amfoster.com (which It is)

I have a line that says
search amfoster,com

I can ping srv (the name of one of my boxes here) and it would be the same as saying
ping srv.amfoster.com
 
Old 12-29-2004, 10:36 PM   #10
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
But I dont have a domain, I just want to connect to the internet via another computer on the network.

Here's my EXACT resolv.conf file....



Quote:
search 255.255.255
# search homeland.net
nameserver 127.0.0.0
nameserver 192.168.0.1

# ppp temp entry
How should that look exactly before I run the route command, and how should I run that route command (with which number?)?



And is that all I have to do to connect to the internet? Just wanna start browsin' the forums with my mozilla instead of IE on this XP machine.
 
Old 12-29-2004, 10:58 PM   #11
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
That file (/etc/resolv.conf) can be changed at any time. It has nothing to do with the route, but rather to point to what nameservers should be checked when reaching out to machines by name rather than IP. You do not need the search line at all. It is there just as a benefit.

As for the default route,
from the command line just type it as root

route add default gw 192.168.0.1 (if that is the IP to the machine actually connected to the internet.

Better would be to have that line executed everytime you boot into Linux.

A simple way would be to write a script and put it in the appropriate rc directory.

Lets say you come up in run level 5 all the time (Xwindows)

Look for the rc5.d directory on your box. In RedHat it is /etc/rc.d/rc5.d

In debian it is /etc/rc5.d

I am not sure about Mandrake. I do not use it, but it was originally based off of redhat, so it may be /etc/rc.d/rc5.d

Create a script such as this
(easy way)

echo "route add default gw 192.168.0.1" > /etc/rc.d/rc5.d/S99myroute

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

Then everytime you boot up, that script will run.

On Redhat there is a file named /etc/rc.local which is executed no matter what run level you go into. The route statement can be put in there as well. It is /etc/rc.d/boot.local on SuSE Linux. Not sure about Mandrake again. I do not use it. I am partial to
Debian, SuSE and then RedHat.

That should work out for you.

I am sure the default route can be set in a GUI dialog on Mandrake, but again, I don't use it, not\r do I do any admin except for at the command line.
 
Old 12-29-2004, 11:13 PM   #12
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
Whoa, okay, you're gettin' ahead of me so far. I'll work on the script once I get connected to the internet for the first time. lol
So this IP of the machine actually connected to the internet, how would I get this? I see NUMEROUS numbers. I see gateway numbers, I see IP address, masks, etc.
Since my connection of the internet goes into this main machine, then through the switch, THEN through to the linux machine, I couldn't use the same IP that the cable company gives me could I? Isn't it a different IP from what my linux box would have (since it goes thru a switch)

Maybe explain that a lil better, then we can work on that script.
 
Old 12-29-2004, 11:25 PM   #13
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
I checked my connections...
192.168.0.1 is the IP that my XP machine gives to the switch.
Now the IP address that my cable company gives me is... 67.177.44.82

I've tried many of those numbers in this line....

route add default gw xxx.xxx.xxx.xxx

and nothing happens... just like it performed the command in the background, doesn't say anything to me. But then I go to Mozilla and try to open a page says it cannot resolve host.
 
Old 12-30-2004, 06:03 AM   #14
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 34
The default route will be the 192.168.0.1 address. That is the machine that connects.

As for redolving host names, You need entries in the /etc/resolv.conf file.

Perhaps:
nameserver 192.168.0.1
nameserver 207.217.120.83

The resolv.conf file lets the Linux box know where the DNS servers are. Just as a test, ping an entity out there in the world by it's IP address. If that works fine, then the /etc/resolv.conf just needs entries.

ping -c3 66.94.234.13
That is yahoo.com

or feel free to ping
207.150.192.12

that is my domain.
 
Old 12-30-2004, 02:06 PM   #15
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
Hmmmm...
I tried to ping both and here's what I get:

Quote:
PING 66.94.234.13 (66.94.234.13) 56 (84) bytes of data.
From 192.168.0.102 icmp_seq=1 Destination Host Unreachable (it does this line 3 times)

3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2009ms, pipe 3
Can ya make anything out from that?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Connecting to the Net LinuxNewBeeSwrm Linux - Networking 5 03-06-2005 12:53 PM
files used while connecting on net ankscorek Linux - Networking 0 09-12-2004 01:08 PM
help connecting to the net bosewicht Linux - Newbie 4 05-29-2004 01:09 AM
Connecting to net THROUGH xp Dill Linux - Networking 1 03-04-2004 01:13 PM
connecting to the net bmxermark Linux - Newbie 5 05-05-2003 08:46 AM


All times are GMT -5. The time now is 05:17 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration