LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-21-2004, 09:41 PM   #1
linuxpyro
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 134

Rep: Reputation: 16
Port forwarding question


Hello,

I have a small home network linked to the Internet via a Linksys router connected to a cable modem. This puts everything on the subnet 192.168.1. for the local network. I have a couple linux servers that I make public, for Web, mail, and SSH. What I would like to do is set up one of the Linux boxes as a second router and create a second subnet for my servers. However, the Linksys router won't do port forwarding to a server on a different subnet, so my only option would be to forward some of the ports on my linux router to the appropriate ports of the servers on the second subnet.

I would like to be able to do this without having to set up network address translation on my router, so that I can still access all the servers from my individual client computers on the original subnet. Is this possible? I Googled and found the SourceForge site for Portfwd, which looks promising. Has anyone here ever used this before? Do I need to set up NAT?

Ben
 
Old 10-22-2004, 02:26 AM   #2
BillJennings
Member
 
Registered: Oct 2004
Location: Big River, California, USA
Distribution: Debian
Posts: 48

Rep: Reputation: 15
Why not change the LAN (internal network) settings on the Linksys router to use a class "B" subnet (192.168.0.0/16). Then add static routes in the Linksys router for one of the subnets (e.g. 192.168.2.0/24) via your linux router. Then you can port forward to an IP address that is not on the local subnet of the Linksys router, but that it has a route for.

Just my $.02

Bill Jennings
 
Old 10-22-2004, 11:45 AM   #3
linuxpyro
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 134

Original Poster
Rep: Reputation: 16
Right now the routing table on my Linksys router looks like this:


Destination LAN IP Subnet Mask Gateway Interface
192.168.2.0 255.255.255.0 192.168.1.2 LAN & Wireless
192.168.1.0 255.255.255.0 0.0.0.0 LAN & Wireless xxx.xxx.xxx.xxx 255.255.248.0 0.0.0.0 WAN (Internet)
0.0.0.0 0.0.0.0 yyy.yyy.yyy.yyy WAN (Internet)

Above xxx.xxx.xxx.xxx rerpresents the external IP of my router, and yyy.yyy.yyy.yyy represents the gateway my router uses. So basically I would just have to change the subnet mask the Linksys uses to /16? How would I arrange the static route with the routing table? Sorry, my experience with network routing is pretty basic...

Last edited by linuxpyro; 10-22-2004 at 07:57 PM.
 
Old 10-22-2004, 08:13 PM   #4
linuxpyro
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 134

Original Poster
Rep: Reputation: 16
OK, sorry for the bad layout of the routing table. The way I have the Linksys set up now is that there is a static route already connecting the two networks. The LAN IP is 192.168.2.0, the subnet mask is set to 255.255.255.0, and the gateway is set to 192.168.1.2. The main subnet the Linksys box sits on is 192.168.1.0.

So to do what you're saying I'd have to change the subnet of the router to /16, and create a new static route and have the destination IP be 192.168.2.0/24?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Port Forwarding Question caps_phisto Linux - Networking 1 07-10-2005 10:33 PM
Port forwarding question GUIPenguin Linux - Networking 1 10-12-2004 01:30 PM
Port forwarding question Doolspin Linux - Networking 2 09-03-2004 10:11 PM
port forwarding question larry Linux - Networking 2 06-10-2004 10:34 AM
Question about Ip/Port Forwarding Half_Elf Linux - Networking 3 10-14-2002 02:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration