Solved

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

Posted on 1997-07-17
3
666 Views
Last Modified: 2010-03-17
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: 208.128.204.1 |
-----------------------
     |
     |
     |
----------------------------
eth0: 208.128.204.2        |
                           |
Linux Box                  |
                           |
ttyS1 serial port:         |
208.128.204.3              |
----------------------------
      |
      |
-----------------
208.128.204.4   |
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:  

208.128.204.3:208.128.204.4

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.

Bonkers,
Chris

cjwong@istep.com
0
Comment
Question by:jcw071697
3 Comments
 
LVL 3

Accepted Solution

by:
sauron earned 200 total points
Comment Utility
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 208.128.204.1, your Linux box's ethernet card is 208.128.204.2. Then, you subnet, so you might give the Linux box's PPP interface an IP of 208.128.204.5. Take an example, to use the minimus number of IP's:-

Ethernet

Network Address    208.128.204.0
Broadcast Address  208.128.204.3
Subnet Mask        255.255.255.252

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

Then, another subnet:-

Network Address    208.128.204.4
Broadcast Address  208.128.204.7
Subnet Mask        255.255.255.252

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

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:-

NETWORKING=YES
HOSTNAME=your.host.here
DOMAINNAME=your.domain
GATEWAY=208.128.204.1           (the router)
GATEWAYDEV=eth0

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
0
 

Expert Comment

by:christg
Comment Utility
Did you tried to add your router IP adress as a gateway in your win95 tcpip configuration.
0
 

Author Comment

by:jcw071697
Comment Utility
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.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now