• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 724
  • Last Modified:

PPP server. Can't ping router. IP forwarding.

I'm trying to setup a ppp dialup server on Linux (2.0.29)/
Debian and am having problems.

I want a Win95 machine to be able to dialup into my linux
box and access the Internet through the linux box which is
connected to a router (internet).

I am able to get the modems to connect and I can ping the
win95 machine from linux and the Win95 machine can ping my
ethernet port. However, I can't get the win95 machine to
ping the router.  So, the Win95 machine cannot access the
Internet (web,etc.), or anything beyond the Linux machine.

Is this an IP forwarding problem?  I'm not sure if I have
IP forwarding turned on or not.  How can I tell?  What does
IP forwarding do anyway?  Does ipfwadm accomplish this? I know ipfwadm is installed.  I know I can access the Internet
from the Linux box w/ no problems. I used debian to install
everything so I can't find any source files around for the
kernel to see if IP forwarding was turned on or not.

Here's my setup:

Internet |
Router: |
eth0:        |
Linux Box                  |
ttyS1 serial port:         |              |
-----------------   |
Win95 machine   |

Does the serial port need its own ip?  Does it have to be a
real IP or can it be a private one?

In my options.ttyS1 (setup for dynamic IP addressing) file
I have:

Is this right?  Or, should it be the ethernet (.2) or
router (.1) address instead of (.3 serial port).  I've
tried all three, and it doesn't seem to matter.  When I
used .1 (router) address I think my linux box got locked
out of the router (couldn't ping the router from linux). I
still can't access the Internet via the WIn95 machine.

Any help would be greatly appreciated.  Everything's been
pretty much setup based on reading the PPP howto, mgetty
stuff, and serial howtos.  If there is addiotional info. needed, please let me know.


1 Solution
Basically, what you're trying to do is set up a separate small network. Assuming you have enough real IP addresses to go round, you have your router on, your Linux box's ethernet card is Then, you subnet, so you might give the Linux box's PPP interface an IP of Take an example, to use the minimus number of IP's:-


Network Address
Broadcast Address
Subnet Mask

This gives a tiny subnet with only two valid IP's, these are, and, which you assign to your router and you Linux box's ethernet interface.

Then, another subnet:-

Network Address
Broadcast Address
Subnet Mask

This gives two more valid IP's, which are, and

So, to do this you'll need a minimum of 7 real IP addresses. If you don't have that many, you need to use masquerading, in which case you can get away with 2, one each for the router and the linux box. Obviously, if you have the whole class C, you don't need to worry about tiny subnets.

Ok, so having sorted this out, you get your Win95 box to dial into the Linux box, and be given the right IP, subnet, etc. It seems you already have this side of things working. Then, you need to make your Linux box do IP routing (IP forwarding). This means that the Linux box must forward packets coming in on the PPP interface across to the ethernet interface. To turn this on, you need to recompile the kernel with IP forwarding enabled. You need to set up your etc/sysconfig/network file up like so:-

GATEWAY=           (the router)

Then, make sure you can get to and beyond the router from the Linux box.

So, then set up your win95 box. In the TCP/IP properties of the PPP connection, you can set up IP address, gateway, DNS servers etc. The gateway for the Win95 machine is the IP address of the Linux box's PPP interface. This is critical for it to work.

Basically, what you have is two small networks, and two routers - your linux box is also a router, and the Win95 machine doesn't need to know anything at all about the real router.

If you don't have enough IP addresses, the situation is the same, but the Win95 machine and the Linux PPP interfcae should be assigned private net numbers, and the kernel on the Linux box should be compiled with masquerading enabled, as well as IP forwarding.

Hope this helps
Did you tried to add your router IP adress as a gateway in your win95 tcpip configuration.
jcw071697Author Commented:
The problem I had turned out to be not having IP forwarding turned on.  So, I recompiled the kernel it all works now.  I did this prior to getting your answer.  But after your answer, it seems that I should have recompiled the kernel (debian linux (2.0.30)) using the "optimize as router" option since you indicated that I am using the Linux box as a router.  I hope
there is not a significant difference between having the linux box optimized as a router v. not optimized.

Thanks for the answer you gave me.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now