How to cfg Linux as a gateway?

How to cfg Linux as a gateway?

Post by Arne Schirmach » Tue, 10 Oct 1995 04:00:00



I want to use my Linux PC as a gateway to the Internet. I have recompiled the
kernel to use IP forwarding. The Linux PC successfully connects via PPP to my
local service provider. From the Linux PC I can ftp to any system on the
Internet. I also can ftp and ping etc. to all systems on the local ethernet
and vice versa. However I have no access from any other system through the
Linux PC to the Internet.

The Linux PC has the ppp0 interface as its default gateway (route add default
dev ppp0). The Sun system has the IP address of the Linux PC as its default
gateway.

It seems (as far as I can tell from the modem LEDs) as if a ping from the Sun
to a system on the Internet successfully makes it through the modem, there
even seems to be a reply (the RxD LED blinks briefly a second later), but
nothing is sent back to the Sun.

Any help is appreciated...
--
                                |  Pix Software GmbH
Arne Schirmacher                |  Apple Macintosh and Sun Solaris
                                |  software development and consulting

 
 
 

How to cfg Linux as a gateway?

Post by BryanRoa » Wed, 11 Oct 1995 04:00:00


Quote:>I want to use my Linux PC as a gateway to the Internet. I have recompiled
the
>kernel to use IP forwarding. The Linux PC successfully connects via PPP
to my
>local service provider. From the Linux PC I can ftp to any system on the
>Internet. I also can ftp and ping etc. to all systems on the local
ethernet
>and vice versa. However I have no access from any other system through
the
>Linux PC to the Internet.
>The Linux PC has the ppp0 interface as its default gateway (route add
default
>dev ppp0). The Sun system has the IP address of the Linux PC as its
default
>gateway.

Your linux box should have 2 IP addresses, one for the PPP connection,
which is supplied by your ISP, and one for the ethernet card. You have to
have a registered class C network for your subnet (Or a portion of a class
C) also from your ISP, and they need to be routing to your subnet.

The default gateway for the linux box should be itself (The IP on the
ethernet card)
then whan dialup for your PPP, you use the defaultroute option - example:

I have an IP from my ISP for my PPP account (204.97.67.120)
I have a Class C domain for my subnet (205.246.60.x) which my ISP has set
up routing for.

The ethernet card in the Linux box is 205.246.60.1, Which is what I set as
the default gateway on that box, as well as the other machines on my
subnet.

I use the following arguments with pppd when dialing into the ISP
/dev/modem 38400 crtscts modem defaultroute 204.97.67.120:

This tells ppp0 to be 204.97.67.120, and once the connection is
establised, to use the link as the default route. Once the link is
established, if i type 'route' to get my route table, the gateway machine
at my ISP is listed as the default route, and all the other machines on my
subnet have access to the internet (For instance i use Win95 on my
pentium, and can run any winsock apps I want).

You also want to make sure you are not defining a default route in your
rc.inet1 file, or the defaultroute option will not work on the pppd
command line.

I did have problems with ppp when i originally installed linux, but is was
a really old kernal version (Something like 1.0.9), I went out and got a
current slakware CD set (v1.2 kernal) and have had no problems. Since then
I've upgraded the kernel to the lastest 1.2.13 version, and continue with
no problems.

Feel free to e-mail me if you have any questions.
_ Bryan

 
 
 

How to cfg Linux as a gateway?

Post by Kace On » Wed, 11 Oct 1995 04:00:00



>>I want to use my Linux PC as a gateway to the Internet. [snip]

>Your linux box should have 2 IP addresses, one for the PPP connection,
>which is supplied by your ISP, and one for the ethernet card. You have to
>have a registered class C network for your subnet (Or a portion of a class
>C) also from your ISP, and they need to be routing to your subnet.

                                 =================================

I think this is the key.  Unless your provider is actively routing
messages back to your subnet, you won't be able to get any reply
from any host outside your subnet.  Ping/telnet/web etc will simply
time out.

Now, does anyone know how to force the provider's routing daemon to
add a new (and temporary) route?

--
~~~~"I'd engage you in a battle of wit but I refuse~~~~
    to fight an unarmed man." -- Cyrano de Bergerac

TELEMATIQUE______8B Ann Siang Hill_______SINGAPORE 0106

 
 
 

How to cfg Linux as a gateway?

Post by roo » Wed, 11 Oct 1995 04:00:00




Quote:

>I want to use my Linux PC as a gateway to the Internet. I have recompiled the
>kernel to use IP forwarding. The Linux PC successfully connects via PPP to my
>local service provider. From the Linux PC I can ftp to any system on the
>Internet. I also can ftp and ping etc. to all systems on the local ethernet
>and vice versa. However I have no access from any other system through the
>Linux PC to the Internet.

>The Linux PC has the ppp0 interface as its default gateway (route add default
>dev ppp0). The Sun system has the IP address of the Linux PC as its default
>gateway.

>It seems (as far as I can tell from the modem LEDs) as if a ping from the Sun
>to a system on the Internet successfully makes it through the modem, there
>even seems to be a reply (the RxD LED blinks briefly a second later), but
>nothing is sent back to the Sun.

It's funny how we went through the same steps and got the same results!
I'm attempting the same thing with identical results to yours. So far, I've
investigated routed, gated, arp,  bcastd (source file has error which I'm not
good enough to fix). Also, the Walnut Creek CD (copy of Sunsite stuff) has
an extensive document on networking which although helpful did not supply
a solution. A fellow on this news group has mentioned that the reason why
our pinging to the internet is only unidirectional is the fact that the
Internet Service Provider must know of your network address for valid
replies to come back. I'm sure their is a way to do this without the ISP's
intervention.

Please include me in your replies should you come across something..


- Show quoted text -

 
 
 

How to cfg Linux as a gateway?

Post by Rich Bla » Fri, 13 Oct 1995 04:00:00





>>I want to use my Linux PC as a gateway to the Internet. I have recompiled the
>>kernel to use IP forwarding. The Linux PC successfully connects via PPP to my
>>local service provider. From the Linux PC I can ftp to any system on the
>>Internet. I also can ftp and ping etc. to all systems on the local ethernet
>>and vice versa. However I have no access from any other system through the
>>Linux PC to the Internet.

>>The Linux PC has the ppp0 interface as its default gateway (route add default
>>dev ppp0). The Sun system has the IP address of the Linux PC as its default
>>gateway.

>>It seems (as far as I can tell from the modem LEDs) as if a ping from the Sun
>>to a system on the Internet successfully makes it through the modem, there
>>even seems to be a reply (the RxD LED blinks briefly a second later), but
>>nothing is sent back to the Sun.

>It's funny how we went through the same steps and got the same results!
>I'm attempting the same thing with identical results to yours. So far, I've
>investigated routed, gated, arp,  bcastd (source file has error which I'm not
>good enough to fix).

ME TOO! ME TOO! ME TOO!  Jeez, maybe we should form a support group... :-)

I've no way to test if my ISP is routing my packets back, do I?

To pass on a hint, get tcpdump, it supposed to be able to help.  Just got
it off of ftp.ee.lbl.gov, and am going to try setting it up tomorrow.

At least I'm not alone...

 Also, the Walnut Creek CD (copy of Sunsite stuff) has

>an extensive document on networking which although helpful did not supply
>a solution. A fellow on this news group has mentioned that the reason why
>our pinging to the internet is only unidirectional is the fact that the
>Internet Service Provider must know of your network address for valid
>replies to come back. I'm sure their is a way to do this without the ISP's
>intervention.

>Please include me in your replies should you come across something..



Rich Bland

 
 
 

How to cfg Linux as a gateway?

Post by Mark J. Dulc » Fri, 13 Oct 1995 04:00:00




>>>I want to use my Linux PC as a gateway to the Internet. I have recompiled the
>>>kernel to use IP forwarding. The Linux PC successfully connects via PPP to my
>>>local service provider. From the Linux PC I can ftp to any system on the
>>>Internet. I also can ftp and ping etc. to all systems on the local ethernet
>>>and vice versa. However I have no access from any other system through the
>>>Linux PC to the Internet.

There are two problems that you may have here.

First, your ISP must provide proxyarp support for your PPP connection.
Most aren't normally set up to do that, and may charge extra for the
privilege.

Second, the computers on your local Ethernet have to have real IP
addresses that are known to the outside world, and to the routers at
your ISP.  Addresses in the 192.168 block (or the other blocks
reserved for machines that won't be on the Internet) won't do;
IP routers don't route packets intended for those networks.  You can't
just make up the addresses; you'll have to get them from your provider
(and likely pay extra for them).

 
 
 

How to cfg Linux as a gateway?

Post by Frankie K.T. C » Sat, 14 Oct 1995 04:00:00


: >>I want to use my Linux PC as a gateway to the Internet. [snip]
: >
: >Your linux box should have 2 IP addresses, one for the PPP connection,
: >which is supplied by your ISP, and one for the ethernet card. You have to
: >have a registered class C network for your subnet (Or a portion of a class
: >C) also from your ISP, and they need to be routing to your subnet.
:                                  =================================

: I think this is the key.  Unless your provider is actively routing
: messages back to your subnet, you won't be able to get any reply
: from any host outside your subnet.  Ping/telnet/web etc will simply
: time out.

: Now, does anyone know how to force the provider's routing daemon to
: add a new (and temporary) route?

I've heard of bcast'd (or something like that) which supposingly would
tell gated runnning on your ISP's machine to modify the routing table
and send packets your way. I have not looked into it and don't know
where to find the package.

As I don't have an official IP address, SLiRP works very well for me.

Frank.
--
"Let's use this Fisher Price (tm) plastic hammer! It's so colourful
and shiny--it has a much better look and feel than that ugly, heavy

 
 
 

How to cfg Linux as a gateway?

Post by Evan Dod » Sat, 14 Oct 1995 04:00:00


: I want to use my Linux PC as a gateway to the Internet. I have recompiled the
: kernel to use IP forwarding. The Linux PC successfully connects via PPP to my
: local service provider. From the Linux PC I can ftp to any system on the
: Internet. I also can ftp and ping etc. to all systems on the local ethernet
: and vice versa. However I have no access from any other system through the
: Linux PC to the Internet.

I have a (sort of) similar problem. I am trying to solve a routing (?) problem
as well. I have a LAN at school which my Linux box is content to work with. I can get out the Wan to Internet, and it can get into me. My problem lies in when I attach to it PPP. I can attach quite fine, but the only visible machine is the host I attached to (not anything else on the ethernet even).

All my routing tables look right as best I can tell, and I have fiddled with almost all the relevant settings I can think of. I am stumped.

If anyone has any ideas, please, please pass them along.

Thanks bunches.

Evan Dodds

 
 
 

How to cfg Linux as a gateway?

Post by Stephen Anspa » Sat, 14 Oct 1995 04:00:00


: I confirm that the ISP must add a route to your internal net(s).

  Yes, _if_ you have legitimate IPs for your subnet.  Using an IP_MASQUERADE
kernel it's not necessary as there's only one IP number to route.

--

- Steve


I'd rather win nothing than Win95.

 
 
 

How to cfg Linux as a gateway?

Post by Derek Wildst » Sun, 15 Oct 1995 04:00:00


: >>I want to use my Linux PC as a gateway to the Internet. [snip]
: >
: >Your linux box should have 2 IP addresses, one for the PPP connection,
: >which is supplied by your ISP, and one for the ethernet card. You have to
: >have a registered class C network for your subnet (Or a portion of a class
: >C) also from your ISP, and they need to be routing to your subnet.
:                                  =================================
:
: I think this is the key.  Unless your provider is actively routing
: messages back to your subnet, you won't be able to get any reply
: from any host outside your subnet.  Ping/telnet/web etc will simply
: time out.
:
: Now, does anyone know how to force the provider's routing daemon to
: add a new (and temporary) route?
:
The provider's subnet route for your net should be added with the
route to your gateway.  Your local gateway should have routes to each
host, as well as a route to your provider's gateway and a default
route through your gateway. Each host on the local net should have a
route to your local gateway, and also have their default route through
your local gateway.  This is currently working for me routing
andromeda through argo (well it was until my ISP accidentally deleted
my default route in their router, oops)
-DW
 
 
 

How to cfg Linux as a gateway?

Post by Alpha N. Spide » Thu, 19 Oct 1995 04:00:00


I have a slightly different problem than the dialup routing and it is:

We are providing an on site IP route to a client that use place their Linux
Boxes at our site. We have setup everything and can ping from our host to any
host on and behind the Linux gateway. However we cannot telnet into the hosts
behind the Linux router.

Our questions is: what have we to do on the Linux Router such that the fill
TCP services are available?

routetrace can ID all machines but no telnet and FTP etc.

We would appreciate some help on this!! Thanks in Advance

 
 
 

How to cfg Linux as a gateway?

Post by Raj Math » Sat, 21 Oct 1995 04:00:00


Your ISP must be either (a) willing to add your Ethernet network
addresses to his routing table or (b) willing to exchange routing
information (RIP, OSPF, etc) with your gateway for your ethernet hosts
to access the rest of the world.

There's also reverse ARP, but I don't know much about that.

-- Raj
#include <std_disclaimer.h>



    >>  I want to use my Linux PC as a gateway to the Internet. I have
    >> recompiled the kernel to use IP forwarding. The Linux PC
    >> successfully connects via PPP to my local service provider.
    >> From the Linux PC I can ftp to any system on the Internet. I
    >> also can ftp and ping etc. to all systems on the local ethernet
    >> and vice versa. However I have no access from any other system
    >> through the Linux PC to the Internet.
    >>
    >> The Linux PC has the ppp0 interface as its default gateway
    >> (route add default dev ppp0). The Sun system has the IP address
    >> of the Linux PC as its default gateway.
    >>
    >> It seems (as far as I can tell from the modem LEDs) as if a
    >> ping from the Sun to a system on the Internet successfully
    >> makes it through the modem, there even seems to be a reply (the
    >> RxD LED blinks briefly a second later), but nothing is sent
    >> back to the Sun.

    root> It's funny how we went through the same steps and got the
    root> same results! I'm attempting the same thing with identical
    root> results to yours. So far, I've investigated routed, gated,
    root> arp, bcastd (source file has error which I'm not good enough
    root> to fix). Also, the Walnut Creek CD (copy of Sunsite stuff)
    root> has an extensive document on networking which although
    root> helpful did not supply a solution. A fellow on this news
    root> group has mentioned that the reason why our pinging to the
    root> internet is only unidirectional is the fact that the
    root> Internet Service Provider must know of your network address
    root> for valid replies to come back. I'm sure their is a way to
    root> do this without the ISP's intervention.
--

PGP: C6 3A 1A 93 DE 08 DA 65  / Ph: 91-11-3317583  / Fax: 3317583

                      It is the mind that moves.

 
 
 

How to cfg Linux as a gateway?

Post by Bjorn Davidsso » Wed, 25 Oct 1995 04:00:00



Quote:

>We are providing an on site IP route to a client that use place their Linux
>Boxes at our site. We have setup everything and can ping from our host to any
>host on and behind the Linux gateway. However we cannot telnet into the hosts
>behind the Linux router.

>Our questions is: what have we to do on the Linux Router such that the fill
>TCP services are available?

I have a Linux box with two netcards set up as a gateway
between a class-C network and a subnetted class-C network
and it works fine.

Quote:>routetrace can ID all machines but no telnet and FTP etc.

Traceroute you mean?

Can you telnet from one hosts to the other (both behind)?
Hmm is the Linux gateway with two network cards?
If so, are the computers on "the other side" on their own
seperate network or do you use subnetting?
If so, do you have the proper subnet mask?
Have you checked "man route" on the Linux gateway?

Please be more detailed and maybe I can help...

-Bjossi-

--
===================================================================


T?lvutjnustan Snerpa sf.                 Snerpa Computing Services
Smi 456-5470 fax 45-5471        Tel. 354-456-5470 Fax 354-456-5471

 
 
 

How to cfg Linux as a gateway?

Post by Peter Bierm » Fri, 05 Jan 1996 04:00:00




> >>I want to use my Linux PC as a gateway to the Internet. [snip]

> >Your linux box should have 2 IP addresses, one for the PPP connection,
> >which is supplied by your ISP, and one for the ethernet card. You have to
> >have a registered class C network for your subnet (Or a portion of a class
> >C) also from your ISP, and they need to be routing to your subnet.
>                                  =================================

> I think this is the key.  Unless your provider is actively routing
> messages back to your subnet, you won't be able to get any reply
> from any host outside your subnet.  Ping/telnet/web etc will simply
> time out.

> Now, does anyone know how to force the provider's routing daemon to
> add a new (and temporary) route?

It's not possible, unless your network range came from your ISP in the
first place.

The backbone networks share a routing table of EVERY ASSIGNED network. So
that routing table has to say that your network should be routed to your
ISPs gateway to the backbone. Then that router needs to know that your
network should be routed to whatever machine serves your PPP connection.
Then that machine needs to know that your network needs to be routed down
your PPP link.

If the range belonged to the ISP in the first place, you could possibly
fool the routing tables inside your ISP into making the correct hops from
*their* gateway to your gateway.

-pmb

--

Packet with a bit not set | <A HREF="http://dax.cs.wisc.edu/~lunatic/">me</a>
SYN ACK SYN ACK,          |"Nobody realizes that some people expend
We all go down.           | tremendous energy merely to be normal."-Al Camus