Help connecting Linux to Internet via LAN router

Help connecting Linux to Internet via LAN router

Post by STaylor6 » Thu, 17 Dec 1998 04:00:00



At our office we are running a Novell 4.11 network (IPX).  We connect to the
Internet through an IPX/IP gateway.  It forwards packets to our router, which
then go to the ISP.

I have set up a computer with RedHat Linux 5.1 on it.  Kernel 2.0.35.  I am
trying to connect to the Internet using our router, but I am not getting it to
work.  This is what I do:

insmod eepro io=0x300 irq=10 . . .  to connect the Intel Ethernet 10 card.
This seems fine.
ifconfig eth0 192.168.1.1 netmask 255.255.255.0

Then when I do ifconfig, it shows both lo and eth0, and eth0 is UP and
receiving packets.  Good so far.  I think I chose a proper IP address for my
machine to make it in the allowable range for Intranets.

route add -net 192.168.1.0
This should point to my computer.  Linux accepts this and the routing table
looks like this:

Destination     Gateway         Genmask Flags Metric Ref   Use
Iface
192.168.1.0     *               255.255.255.0   U       0       0       0  
eth0
127.0.0.0               *               255.0.0.0               U       0      
0       0    lo

Then I need to connect to our router, which is 208.198.203.125.  This is where
I run into trouble.
route add 208.198.203.125 results in SIOCADDRT: network is unreachable

So I route del and try again, this time trying
route add -net default gw 208.198.203.125 eth0

Then when I try to look at the routing table, it lists the first two lines and
freezes.  I have to ctrl-c out.
Through various combinations, the best I have ever done is to ping the ISP's
WAN port, but nothing beyond that returns any packets to me.

BTW, our IPX/IP gateway connects to the router using a mask of 255.255.255.128.

As you can see, I know just enough to be dangerous, but not enough to
accomplish what I want.  I have been through the network HOWTO and the
newsgroups, but I still can't figure it out.  What am I missing here?

TIA
Steve

 
 
 

Help connecting Linux to Internet via LAN router

Post by centaur » Fri, 18 Dec 1998 04:00:00



> I have set up a computer with RedHat Linux 5.1 on it.  Kernel 2.0.35.  I am
> trying to connect to the Internet using our router, but I am not getting it to
> work.  This is what I do:
> insmod eepro io=0x300 irq=10 . . .  to connect the Intel Ethernet 10 card.
> This seems fine.
> ifconfig eth0 192.168.1.1 netmask 255.255.255.0

The 192.168.0.0 - 192.168.255.0 IP address are set aside as private
network blocks and are not routable on the Internet without a masquerade
or proxy server.

Quote:> Then when I do ifconfig, it shows both lo and eth0, and eth0 is UP and
> receiving packets.  Good so far.  I think I chose a proper IP address for my
> machine to make it in the allowable range for Intranets.
> route add -net 192.168.1.0
> This should point to my computer.  Linux accepts this and the routing table
> looks like this:
> Destination        Gateway         Genmask Flags Metric Ref   Use
> Iface
> 192.168.1.0        *               255.255.255.0   U       0       0       0  
> eth0
> 127.0.0.0          *               255.0.0.0               U       0      
> 0       0    lo
> Then I need to connect to our router, which is 208.198.203.125.  This is where
> I run into trouble.
> route add 208.198.203.125 results in SIOCADDRT: network is unreachable

Your Linux system (if I understand from above) is not on the same subnet
as your router.  You'll need a router on the 192.168.1.0 subnet to
connect to the 208.198.203.125 router.  The gateway that your Linux box
uses will need an address on the 192.168.1.0 subnet.

Quote:> So I route del and try again, this time trying
> route add -net default gw 208.198.203.125 eth0
> Then when I try to look at the routing table, it lists the first two lines and
> freezes.  I have to ctrl-c out.
> Through various combinations, the best I have ever done is to ping the ISP's
> WAN port, but nothing beyond that returns any packets to me.
> BTW, our IPX/IP gateway connects to the router using a mask of 255.255.255.128.

This looks like the connection from your gateway to the ISP's router.  
The other side, as you mention, is IPX, so it's unlikely that your router
can do much for you.  For this to work, you will need to put the Linux
system on the Internet link to the ISP (which is probably a serial data
line and not a ethernet connection).  This might require the ISP to
assign an IP address to your Linux box unless you control a block of them.

Quote:> As you can see, I know just enough to be dangerous, but not enough to
> accomplish what I want.  I have been through the network HOWTO and the
> newsgroups, but I still can't figure it out.  What am I missing here?

Check out O'Reilly's TCP/IP Network Administration book.

--
Charles Rutledge    |    Liberty is a tenuous gift.  Hard to win, easy


 
 
 

Help connecting Linux to Internet via LAN router

Post by Vincent Zweij » Fri, 18 Dec 1998 04:00:00



||  At our office we are running a Novell 4.11 network (IPX).  We connect to
||  the Internet through an IPX/IP gateway.  It forwards packets to our router,
||  which then go to the ISP.
||
||  I have set up a computer with RedHat Linux 5.1 on it.  Kernel 2.0.35.  I am
||  trying to connect to the Internet using our router, but I am not getting it
||  to work.  This is what I do:
||
||  insmod eepro io=0x300 irq=10 . . .  to connect the Intel Ethernet 10 card.
||  This seems fine.
||  ifconfig eth0 192.168.1.1 netmask 255.255.255.0

192.168.x.0 are reserved networks, and won't be reachable from
outside without additional measures (NAT/IP Masquerading).  Are you
sure 192.168.1.0 is your local network address (and 192.168.1.1 your
machine's address)?

||  Then when I do ifconfig, it shows both lo and eth0, and eth0 is UP and
||  receiving packets.  Good so far.  I think I chose a proper IP address for
||  my machine to make it in the allowable range for Intranets.
||
||  route add -net 192.168.1.0
||  This should point to my computer.  Linux accepts this and the routing table
||  looks like this:

[Reformatted.  Please use a fixed width font and don't word wrap.]

||  Destination  Gateway  Genmask        Flags  Metric  Ref  Use  Iface
||  192.168.1.0  *        255.255.255.0  U      0       0    0    eth0
||  127.0.0.0    *        255.0.0.0      U      0       0    0    lo

A good routing table, provided that 192.168.1.0 is correct.

||  Then I need to connect to our router, which is 208.198.203.125.  This is
||  where I run into trouble.
||  route add 208.198.203.125 results in SIOCADDRT: network is unreachable

You're adding a route to 208.198.203.125 and expect the system to divine
where those packets have to go.  It does its best trying 208.198.203.0
(probably), but that fails.  This is not going to work.

||  So I route del and try again, this time trying
||  route add -net default gw 208.198.203.125 eth0

The router has more than one address; one for each interface.  The "outer"
interface of your router is probably 208.198.203.125.  You need the
address of the "inner" interface, which is probably on the internal
192.168.1.0 network.  You might guess 192.168.1.1 or 192.168.1.254.

If 208.198.203.125 is actually the inner address, then you local network
is probably 209.198.203.0/255.255.255.128 (see below for netmask) instead
of 192.168.1.0/255.255.255.0.  Also, your machine's address will be on
that network.

||  Then when I try to look at the routing table, it lists the first two lines
||  and freezes.  I have to ctrl-c out.

The route command is trying to find out hostnames associated with the
addresses.  However, your routing table is incorrect and route has to
wait for the lookups to timeout.  Wait long enough, and route will give
up and print numbers anyway.

It used to work before because your routing table didn't give a route to
the name server at all instead of a wrong one.  Therefore, route could
give up quickly.

Use the -n option to route to skip the lookups and print numbers.

||  Through various combinations, the best I have ever done is to ping the
||  ISP's WAN port, but nothing beyond that returns any packets to me.

Duh!  And which combination was that?!

||  BTW, our IPX/IP gateway connects to the router using a mask of
||  255.255.255.128.

This doesn't matter too much right now.  You could specify the netmask
with ifconfig and route.

||  As you can see, I know just enough to be dangerous,

I agree completely.  :-)

||                                                      but not enough to
||  accomplish what I want.  I have been through the network HOWTO and the
||  newsgroups, but I still can't figure it out.  What am I missing here?

Either figure out your own address and that of the network you're on,
or figure out the internal address of the router, which is most probably
on the local network.
--

<http://www.xs4all.nl/~zweije/>      | don't read, does anybody get burnt?"
[Xhost should be taken out and shot] |            -- Paul Tomblin on a.s.r.

 
 
 

Help connecting Linux to Internet via LAN router

Post by STaylor6 » Sat, 19 Dec 1998 04:00:00


Thanks to Charles and Vincent for your responses!


>Are you sure 192.168.1.0 is your local network address (and 192.168.1.1 your

machine's address)?

No, it isn't.  I read somewhere that you should use that range for private
networks, so I thought I would try it.  I checked our records, and we were
allocated 208.198.203.0 - 127.  We are only using a couple of those addresses,
including the router's 208.198.203.125.  So I am now going to assign my
computer 208.198.203.2.

ifconfig eth0 208.198.203.2 netmask 255.255.255.128

I am adding the netmask because we were told by our ISP that we had such, plus
it is in our router.  I have been reading about these and still do not fully
understand the effect it has when I use it in these commands, and I haven't
seen a difference when I leave it out.

Our router is set up for IP only, no IPX.  I checked the router's configs; the
address for the "inner" interface is 208.198.203.125.

Then I start adding my routes.  Local is already there.
route add -net 208.198.203.0 netmask 255.255.255.128 eth0
route add 208.198.203.125  (for a static route to the router)
route add default gw 208.198.203.125

Quote:>[Reformatted.  Please use a fixed width font and don't word wrap.]

Sorry about that.  This time I will use a fixed width font, but AOL must be
doing the word wrap.  Our ISP does not have a news server, so I am using my AOL
account for this.  :-)  Here is the new route table:

Destination             Gateway         Genmask         Flags
Metric Ref      Use Iface
208.198.203.125 0.0.0.0         255.255.255.255 UH
0        0      2       eth0
208.198.203.0   0.0.0.0         255.255.255.128 U       0
 0      0       eth0
127.0.0.0               0.0.0.0         255.0.0.0               U
0        0    1 lo
0.0.0.0         208.198.203.125 0.0.0.0         UG
0        0      2     eth0

The route freezes with the addition of the gateway, so I did a route -n.

Quote:>It used to work before because your routing table didn't give a route to
>the name server at all instead of a wrong one.  Therefore, route could
>give up quickly.

I went over your information regarding this and still I do not understand
something.  What does a name server have to do with this?  I am only using IP
addresses at this point.

With the above combination of routes, I can ping and receive packets back from
the ISP's WAN port.  Beyond that, the packets go out but I receive nothing
back.

Quote:>Duh!  And which combination was that?!

Ack!  It is 'Duh!' for you, but not for me.  :-)  That's why your responses are
so helpful.  What could I try at this point?

Thank you again!

Steve

 
 
 

Help connecting Linux to Internet via LAN router

Post by STaylor6 » Sat, 19 Dec 1998 04:00:00


Vincent, I just read your response to another person titled: "Re:
Looooooooooooong delay in route table generation".  That explains my question
about why there is a delay in the route command.  I do have my resolve.conf and
host.conf files set up.  I used linuxconf to do this.  I cannot ping our DNS,
so that must be why there is a delay in the route command - it cannot yet reach
the DNS.

Thanks again for your explanations.

Steve

 
 
 

1. linux box as router between LAN and internet-via-ppp / help requested

Hi:

My Linux box is connected to the local network.  It has its own IP
address on that network.  My Linux box is also connected to the rest
of the internet via a PPP connection.  It has its own IP address for
that PPP connection too (dynamically assigned).

My Linux box has kernel support for forwarding/routing packets.
My Linux box has kernel support for having two IP addresses for just
this sort of occasion (CONFIG_DUMMY is set).

On the local network I tell a Win95 machine (it doesn't have to be
Win95, but in this case it is) that my Linux box is the gateway for
that Win95 machine.

There exists a route from my Linux box to the Win95 machine.

Let's call the eth0 IP address of my Linux box ETHIP.
Let's call the ppp0 IP address of my Linux box PPPIP.

Now let's test:

From my Linux box, I can ping the Win95 machine.
From my Linux box, I can ping my ppp peer (and the rest of the
  Internet).

From the Win95 machine, I can ping ETHIP.
From the Win95 machine, I can also ping PPPIP.

I cannot, however, ping even one machine beyond my Linux box from the
Win95 machine.  This is the crux of the problem, and I'm not quite
sure what to configure (or how to configure it) on my Linux box in
order to successfully route the packets from the Win95 machine to
my ppp peer.

I've looked briefly at gated, but I couldn't find source code nor
man pages nor sample config files at sunsite, so I didn't know if
that was the right package to use or not.  I'm also unfamiliar with
routed.  The NET-2-HOWTO didn't offer detailed help either.

Any and all help would be appreciated.  Please send ideas to my

posting.

Many thanks in advance,
  jim

2. How to automate ftp transfer using shell script?

3. cannot connect to Qube 3 server via Internet or LAN - please help (long)

4. Terminology: "Hacker" vs "Cracker".

5. Linux connecting to Internet via TCP/IP LAN

6. Please Help: Need Linux

7. can not connect to internet via my linksys router on fedora linux desktop

8. samba compile on RH4.2 intel

9. Win98 connect to internet via linux router with ISDN card (ISDN configured yet)

10. Connect via LAN vs. Connect via modem headache

11. connect to Internet via LAN

12. Connecting 2 Windows LANS via Internet

13. connect to internet via MS-LAN