Networking Forums

Networking Forums > Computer Networking > Linux Networking > Crazy iptables question...

Reply
Thread Tools Display Modes

Crazy iptables question...

 
 
Thad Trusler
Guest
Posts: n/a

 
      04-19-2004, 11:34 PM
My Linux box has 3 interfaces.

eth0 - connection to the internet.
eth1 - connection to a single machine (sysA), secluded network (netA).
eth2 - connection to a single machine (sysB), secluded network (netB).

Here's my task:
I need to create a setup where sysA and sysB can have the same network
configuration, (ie. IP Address and Gateway) and be NATted to an
internet address.

This would require:
eth0 to be set to 10.11.11.7
eth1 and eth2 to be set to 192.168.0.1
sysA and sysB to be set to 192.168.0.2
sysA NATted to 10.11.11.4
sysB NATted to 10.11.11.5

I'm also open to other possible suggestions....only requirement: sysA
and sysB must have the same IP Address and gateway address. Also
prefer to stay away from MAC Address dependant schemes.

Thanks in advance.
Thad T
 
Reply With Quote
 
 
 
 
jack
Guest
Posts: n/a

 
      04-21-2004, 12:08 PM
Thad Trusler wrote:
> My Linux box has 3 interfaces.
>
> eth0 - connection to the internet.
> eth1 - connection to a single machine (sysA), secluded network (netA).
> eth2 - connection to a single machine (sysB), secluded network (netB).
>
> Here's my task:
> I need to create a setup where sysA and sysB can have the same network
> configuration, (ie. IP Address and Gateway) and be NATted to an
> internet address.
>
> This would require:
> eth0 to be set to 10.11.11.7
> eth1 and eth2 to be set to 192.168.0.1
> sysA and sysB to be set to 192.168.0.2
> sysA NATted to 10.11.11.4
> sysB NATted to 10.11.11.5
>
> I'm also open to other possible suggestions....only requirement: sysA
> and sysB must have the same IP Address and gateway address. Also
> prefer to stay away from MAC Address dependant schemes.


First of all, what the hell do You want this for...?

Anyways, here we go:

You will have to decide on the interface name how to route and NAT
Your packets. So You will use iptables rules like this:

Packets arriving on eth1 will be SNATted to 10.11.11.4 an then be
forwarded out via eth0 (I assume that this is what You want).
- Same goes for traffic from sysB. This direction, from sys{A,B} to
the outside, was the simpler one.

For the other way, things are a bit more complicated to achieve.
You will have to decide on the destination address which NIC to use
to deliver the packets (10.11.11.4 and .5, that is). Then, You will
DNAT these packets accordingly. Have a look at www.lartc.org and others
for how to do that.


This does not sound like a good idea. Jack.

--
----------------------------------------------------------------------
My personal reading of the string "MicroSoft" expands to "NanoWeak"...
 
Reply With Quote
 
Thad Trusler
Guest
Posts: n/a

 
      04-22-2004, 07:10 PM
jack <(E-Mail Removed)> wrote in message news:<c65o0d$k6k$03$(E-Mail Removed)>...
> Thad Trusler wrote:
> > My Linux box has 3 interfaces.
> >
> > eth0 - connection to the internet.
> > eth1 - connection to a single machine (sysA), secluded network (netA).
> > eth2 - connection to a single machine (sysB), secluded network (netB).
> >
> > Here's my task:
> > I need to create a setup where sysA and sysB can have the same network
> > configuration, (ie. IP Address and Gateway) and be NATted to an
> > internet address.
> >
> > This would require:
> > eth0 to be set to 10.11.11.7
> > eth1 and eth2 to be set to 192.168.0.1
> > sysA and sysB to be set to 192.168.0.2
> > sysA NATted to 10.11.11.4
> > sysB NATted to 10.11.11.5
> >
> > I'm also open to other possible suggestions....only requirement: sysA
> > and sysB must have the same IP Address and gateway address. Also
> > prefer to stay away from MAC Address dependant schemes.

>
> First of all, what the hell do You want this for...?
>
> Anyways, here we go:
>
> You will have to decide on the interface name how to route and NAT
> Your packets. So You will use iptables rules like this:
>
> Packets arriving on eth1 will be SNATted to 10.11.11.4 an then be
> forwarded out via eth0 (I assume that this is what You want).
> - Same goes for traffic from sysB. This direction, from sys{A,B} to
> the outside, was the simpler one.
>
> For the other way, things are a bit more complicated to achieve.
> You will have to decide on the destination address which NIC to use
> to deliver the packets (10.11.11.4 and .5, that is). Then, You will
> DNAT these packets accordingly. Have a look at www.lartc.org and others
> for how to do that.
>
>
> This does not sound like a good idea. Jack.



Thanks for the info, Jack.

You're right, terrible idea...but I do have a reason.

Image a classroom environment where all systems are Ghosted and built
before the class begins. Now imagine the Ghosted image contains a
brain-dead application that has issues with a changing IP/hostname
(WebSphere comes to mind, there are others.)

Now imagine being able to Ghost as many systems as you need behind
your handy-dandy linux router without modifying the systems when they
finish.

Now the big one...take it to the Virtual Machine realm where your
Ghost is merely a file copy.

Even if I get this to work, it's really only necessary when the
customer application can't be automated easily to handle an IP address
change. (Operative work being easily. I won't be doing the work.)

Thad
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Switch going crazy - question boise_bound@hotmail.com Network Routers 0 10-02-2006 03:39 PM
iptables question adam Linux Networking 1 07-13-2005 07:14 PM
crazy question: temporarily blocking self from selected domains? Jim Linux Networking 2 02-25-2005 08:42 PM
IPTABLES question John Norvell Linux Networking 5 11-08-2004 04:38 AM
Iptables question : need help =) mcd Linux Networking 3 07-31-2004 07:18 PM



1 2 3 4 5 6 7 8 9 10 11