modem and router port forwarding

I am having some router networking issues...here is my configuration:

I have a DSL modem at 192.168.254.254. I configured port forwarding for ports 22 and 1521 to route to 192.168.254.1.

I have a router at 192.168.0.1.  I have port forwarding configured to forwarding ports 22 and 1521 to 192.168.0.50.

I have a linux server at 192.168.0.50.

When I use PuTTY to SSH on port 22 to the linux server I get a prompt to login to the linux server but it does not allow me to login.  I get an error message that access is denied.

So it looks like traffic is getting to the linux server but the linux server is not allowing me to login.

Note that I am able to login if I am on the local network and use SSH to connect to 192.168.0.50.  I only have a problem if I try to connect to the linux server using the public IP address.

Do you know what I can change to allow access to the linux server?

Note that I am confused about how traffic gets from 192.168.254.1 to 192.168.0.1.  The default gateway is 192.168.0.1.  I am not able to set the port forwarding in the DSL modem to 192.168.0.1.  If I try I get the error message "NAPT server IP address is not a valid host LAN address."

Can you point me to a log file on the linux server that explains why it's rejecting the login from the public IP address?

Can you tell me how to either configure the linux server or the network to allow logins from the public IP address?  Note that this was working at one point.  I believe a tech support person from the router company had me change my network IP address and after that I was not able to connect to the linux server through the public IP address.
david_m_jacobsonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Fred MarshallPrincipalCommented:
Let's review those port forwards:

"I have a DSL modem at 192.168.254.254. I configured port forwarding for ports 22 and 1521 to route to 192.168.254.1."

Presumably 192.168.254.1 is the router WAN/Internet side, yes?  If so then understood.

"I have a router at 192.168.0.1.  I have port forwarding configured to forwarding ports 22 and 1521 to 192.168.0.50."

Presumably this is the router with WAN address 192.168.254.1, yes?  If so, OK.

It sounds like it may work:
Packets arriving at the modem router, destined for port 22 will go to 192.168.254.1.  But, to which port there?  That has to be part of the setup.
I'm going to suggest something different just to make the point:

When packets arrive for port 22 then we will forward then to 192.168.254.1:999 that is, port 999.

When packets arrive for port 999 at 192.168.254.1 then we will forward them to 192.168.0.50:22  that is port 22.  

I believe that's what you want.
So it could be:
port 111 from the outside world
port 222 between the routers
port 22 behind the last router.

That should be all there is to it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
david_m_jacobsonAuthor Commented:
I don't follow everything stated above. In the SpeedStream 4300 DSL Modem configuration in the Host Configuration I see the Default Gateway set to an empty field and I see a checkbox that is checked to indicate "Use WAN."

In the DHCP Configuration of the DSL modem I see DHCP enabled, "Start IP Range" set to 192.168.254.1 and the "End IP Range" set to 192.168.254.253.  Then I see the Default Gateway set o 192.168.254.254.

Note that I have two physical devices: a SpeedStream 4300 DSL modem and an Encore router.  The DSL modem is plugged into the Encore router.  The linux box is plugged into the Encore router.

I don't understand how to configure 192.168.254.1.

Separately, I have a Windows PC connected to the Encore router.  When I enter "ipconfig /all" from a DOS prompt on the Windows PC I see the DNS server, Default Gateway, and DHCP Server all set to 192.168.0.1.

When I log into the admin tool for the Encore router I see the WAN Settings section with the IP address set to 192.168.254.1 and the Default Gateway set to 192.168.254.254. In the LAN Settings section of the Encore Router I see the IP address set to 192.168.0.1 and DHCP enabled.

Does any of this information help? I'm not sure I followed your suggestion.  I think you are suggesting setting the DSL Modem to forward incoming requests on port 22 to port 999 on the Encore router.  Then I should configure the Encore router to forward incoming requests on port 999 to port 22 on my linux server at 192.168.0.50.  Is that correct?
Fred MarshallPrincipalCommented:
Sorry I didn't respond sooner.  Thanks for the points!

Yes that's the idea and it sounds like it worked!  Good.

I wasn't trying to suggest any particular port numbers .. those were just examples.  You'd want to avoid "well known" port numbers.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Network Management

From novice to tech pro — start learning today.