LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-30-2004, 02:53 PM   #1
laclac01
Member
 
Registered: Feb 2004
Posts: 36

Rep: Reputation: 15
help with iptables and forwarding


Can someone help me? I have two subnets, 192.168.100.0 and 192.168.1.0. they are connected to each other via two “gateways"


Easy enough. Two gateways because both networks were originally separate and are now joined. What I want to do is to be able to associate a specific ip address on the 192.168.1.0 side with a specific ip address on the 192.168.100.0 side. So any requests to 192.168.1.6 will go specificity to 192.168.100.6 and any requests for 192.168.1.5 will go to 192.168.100.5, ect... I do not want port forwarding. For the sake of conversation i might want two webservers running on the 192.168.100.0 side both running port 80. or ping 192.168.1.5 to see if 192.168.100.5 is up. I want all requests for a specific ip on the 192.168.1.0 side to be sent to the 192.168.100.0 side to a specific ip address. I have many free 192.168.1.0 ip address. I can not combine the two networks in to one, the IP address have to stay their ip addresses. Also I don’t have access to the 192.168.1.1 Gateway, can't change it, can't log on to it, can even look at it. But I can do what ever to the 192.168.100.1 gateway. On it now I am running redhat 7.3 using iptables and NAT. Is there something called static NAT or something that can accomplish this? Plus how do i get the 192.168.100.1 gateway's eth0 to actually not ignore stuff headed for 192.168.1.0??? Do I have to do ifconfig eth0:1 blah blah.... Any help would be appreciated. From what I have been reading this can be accomplished with some IPTABLES rules but I am not sure even where I begin.
Thanks

Last edited by laclac01; 04-30-2004 at 02:54 PM.
 
Old 10-23-2005, 07:16 AM   #2
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 234Reputation: 234Reputation: 234
Although old, this is still an interesting question; can you supply more information?

Do you indeed want to map all IP addresses on Net-1 (192.168.1.0) to the corresponding IP address on Net-2 (192.168.100.0)? 192.168.1.n ==> 192.168.100.n

The topology isn't clear --
Quote:
They are connected to each other via two "gateways".
Does this mean that each gateway has an additional NIC connected by a cross-over cable to the other?

Although we might be curious as to why you can't access the Net-1 Gateway (192.168.1.1), we don't need that info. to solve the problem.

The important question is whether your Net-2 gateway (192.168.100.1) "sees" all traffic on Net-1. If the packets on Net-1 never get to a router under your control, you can't forward them to anything on Net-2.

Do the IP addresses on Net-1 (192.168.1.n) represent real machines; and, if so, do you want to
a) divert or
b) duplicate
the packets on Net-1 to Net-2?

Yes, there is something called static NAT (SNAT), & it may be what you need.

Where to begin w/ IPTABLES rules is a huge Q; "RTFM", while always a good idea, will only scratch the surface.

Last edited by archtoad6; 10-23-2005 at 07:20 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
iptables forwarding... AnalyticaL Linux - Networking 5 09-28-2004 08:55 AM
iptables and forwarding rincewind Linux - Networking 2 03-30-2004 11:23 AM
Iptables Forwarding Help!! jglazner Linux - Networking 2 10-20-2003 05:04 PM
IP forwarding through iptables harshalupatel Linux - Networking 0 06-18-2003 01:29 PM

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

All times are GMT -5. The time now is 03:11 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