Hi,

OK, great, a routing lesson.

You have to see your machine not as one machine having several IP addresses,
but instead see your machine as different interfaces, that interact and send
data to each other. Your localhost interface (lo) is one, your ethernet card
(eth0) is another and your dialup (ppp0) is yet another.

When trying to make a connection to a server on the Internet you are
essentially sending a network packet, which, amongst other things, contains
a sender IP address (your outgoing interface's IP address) and a destination
IP address (the IP address of the server you requesting data from).

This network packet now looks at your routing table to see where the
destination IP address is located. A routing table could look something like
this (Hint: route -n) :
192.168.1.10  0.0.0.0         255.255.255.0  U     0      0        0 eth0
192.168.1.0   0.0.0.0         255.255.255.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

This shows the packet, that it has to look for any IP addresses, other than
192.168.1.10 (which is the own ethernet adapter) and 192.168.1.xxx (which is
your own network) via 192.168.1.1 (which is the default gateway for all
addresses other 192.168.1.xxx).

So by pointing your default route via gateway localhost on eth0 with 'route
add default gw localhost eth0' you totally confused networking telling your
TCP network packet to look for all destination IP addresses via gateway
localhost (which normally is assigned to the interface lo), but look for
localhost through your ethernet card (eth0). Makes no sense? Correct,
because it doesn't. If you want to do this sort of thing use:

route add default eth0

Yet this will still not show your TCP network package to find the way out of
your local network to the WWW (wide wide world ; - ) ). With the above
routing you should be able to see any servers on the same network as your
machine, but you should be unable to see anything else (there might be
exceptions, so do not flame me). With:

route add default gw <whatever your gateway's IP is> eth0

you should see the world.

Hope this helps.

Bernhard Luder

This electronic mail is solely for the use of the addressee and may contain
information that is confidential or privileged.  If you receive this
electronic mail in error, please delete it from your system immediately and
notify the sender by electronic mail.



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Michael Lake
Sent: Thursday, 12 April 2001 11:53
To: [EMAIL PROTECTED]
Subject: Re: [SLUG] Can't resolve outside sites after new Deb
installation.


Bernhard Luder wrote:
> it needs a default route and default gateway
> route add default gw 192.168.0.1 eth0

OK thanks - working now. I did this but used the static IP address
assigned to my machine instead of the 192 one - is that correct?. Well
it certainly works, now I can reach outside.

OK I can understand that the packets need to be told where to go but as
I am at a uni site, ie not dialup, why would the gateway be set to be my
own machine? Just to try things I therefore tried
        route add default gw localhost eth0
but it does not work.

Clearly I dont really follow whats happening here. RedHat obviously set
this for me last time. Bless their souls :-)

Mike
--
-------------------------------------------------------
Michael Lake
University of Technology, Sydney
Ph: 9514 1724 Fx: 9514 1628 email: [EMAIL PROTECTED]
Web: http://www.science.uts.edu.au/~mikel
-------------------------------------------------------

--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug

Reply via email to