LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-23-2003, 10:22 PM   #1
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Rep: Reputation: 31
What's a default gateway and do I need one?


I'm trying to network my PS2 (running Linux, of course), but it ain't workin'. I don't have a default gateway and something tells me I need one. None of my books really say what it is or if I really need one.
 
Old 05-23-2003, 10:48 PM   #2
manthram
Member
 
Registered: Feb 2002
Location: Fairfax, VA
Distribution: RedHat 8, Mandrake9.1, Slack9
Posts: 456

Rep: Reputation: 31
a default gateway is the machine through which all your network traffic goes through to the other networks

what is your network setup. do you have a static ip or dhcp. if you get the ip by dhcp then it will automatically take care of it. if you did setup a static ip then you need to specify the default gateway.
 
Old 05-23-2003, 11:09 PM   #3
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
I have a static ip, but I assume I don't I need to define a default gateway if don't connect through another machine, right?
 
Old 05-23-2003, 11:15 PM   #4
manthram
Member
 
Registered: Feb 2002
Location: Fairfax, VA
Distribution: RedHat 8, Mandrake9.1, Slack9
Posts: 456

Rep: Reputation: 31
if you are connecting through other machine then the first machine in the line will be the default gateway for the second machine.


internet
|
machine 1
| |
machine 2 machine 3


now you see machine 1 will be the default gateway for machine 2 and 3. if machine 2 and 3 get their ip by dhcp from machine 1then it will automatically set the default gw. but if you are giving static ips to the 2 and 3 machines then you need to specify the default gateway.

put this line in '/etc/sysconfig/network-scripts/ifcfg-eth0'

DEFAULT GATEWAY=machine 1 ip
 
Old 05-24-2003, 10:48 AM   #5
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
What about computer 1? Does it need a default gateway of some sort, or is it OK to leave it blank?
 
Old 05-24-2003, 11:14 AM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
If it has internet access then it obviously has all the routes set. If you want internet access through another linux box you will need to enable ip forwarding and masquerading. If the other box is windows you will need to have ICS installed.
 
Old 05-24-2003, 11:40 AM   #7
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
No, it's not connected to the Internet. It can't even ping anything. I thought it was a problem with the default gateway, but I'm beginning to see it isn't the default gateway and something else is wrong. I have no idea what it could be now.
 
Old 05-24-2003, 11:49 AM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Ok I'm getting a bit lost now. can you post (in CODE blocks) the output from the following commands on each box:
ifconfig
route -n


Do you want to have internet access or just network access?
 
Old 05-25-2003, 06:44 PM   #9
Travis86
Member
 
Registered: Dec 2002
Location: The land of GMT -6
Distribution: OS X, PS2 Linux, Ubuntu, IRIX 6.5
Posts: 399

Original Poster
Rep: Reputation: 31
I believe the scource of your confusion is that you assume I know what I'm doing. I had a network problem where I couldn't ping anything. I knew that all the network information was correct, except I didn't have anything as the default gateway. I didn't know what a default gateway was and thought I might need one. I see now that I don't. A default gateway is kind of like your proxy server, right?

Strangely enough, everything works normally now. I don't know what was wrong, and I don't know what fixed it, but at least it works.

Thank you all for enlightening me about default gateways.

But, if you sill think it's important, here is the readout of ifconfig:

eth0 Link encap:Ethernet Hwaddr ---blah, blah, blah
inet addr:10.0.0.3 Bcast 10.255.255.255 Mastk:255.0.0.0
UP BROADCAST NUNNING MULTICAST MTU:1500 Metric:1
RX packets:111 errors:0 dropped:0 overruns:0 frame:0
TX pacets:27 errors:0 dropped:0 overruns:0 frame:0
collisions:0 txqueuelen:100

lo Link encapLocal Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
RX packets:12 errors:0 dropped:0 overruns:0 frame:0
TX pacets:12 errors:0 dropped:0 overruns:0 frame:0
collisions:0 txqueuelen:0


... and here is the readout of route -n:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Ifase
10.0.0.3 0.0.0.0 255.255.255.255 UH 0 0 0 eth0
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo


And yes, folks, that last addres is 127.0.0.0 . I just noticed that right now, and I don't think it's right, but I don't know enough to know if I should worry. When I ping 127.0.0.0 it says:

Do you want to pring broadcast? Then -b

When I "ping 127.0.0.0 -b" it says "pinging broadcast address". I thought my broadcast address was 10.255.255.255 . What's going on?
 
  


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
Default gateway dooda5555 Linux - Networking 1 06-17-2005 12:43 PM
HELP default gateway MrSavage Linux - Newbie 2 01-10-2005 08:46 AM
Default Gateway rrosenkoetter Linux - Networking 3 08-27-2004 09:41 AM
default gateway avikosan Linux - Networking 3 12-09-2003 06:47 PM
Cannot change default gateway parr Linux - Networking 22 07-31-2003 07:13 PM


All times are GMT -5. The time now is 05:15 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration