Networking Forums

Networking Forums > Computer Networking > Linux Networking > Advanced routing question

Reply
Thread Tools Display Modes

Advanced routing question

 
 
Hans
Guest
Posts: n/a

 
      05-07-2004, 11:41 AM
Hello.
I have a box with 4 nic's, eth0 .. eth3;

eth0 is on 192.168.x.x; eth1 and 2 are on 10.10.x.x; eth 3 is on
172.16.x.x
eth1 and eth2 are connected to eachother by a crossed UTP-cable.

What I want is that all incoming traffic on eth0 that is destined for
172.16.x.x, to be rerouted NOT immediately to eth3, but to be routed
to go out on eth1, and then when it comes back in through eth2, then
it must go out on eth3.

And also vice versa, that is all ip that comes in on eth3 and is
destined for 192.168.x.x, to go out on eth2, come in again on eth1 and
finally leaves via eth0.

How to do this?
Any hints appreciated.
 
Reply With Quote
 
 
 
 
Hans
Guest
Posts: n/a

 
      05-07-2004, 02:01 PM

"Hans" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> Hello.
> I have a box with 4 nic's, eth0 .. eth3;
>
> eth0 is on 192.168.x.x; eth1 and 2 are on 10.10.x.x; eth 3 is on
> 172.16.x.x
> eth1 and eth2 are connected to eachother by a crossed UTP-cable.
>
> What I want is that all incoming traffic on eth0 that is destined for
> 172.16.x.x, to be rerouted NOT immediately to eth3, but to be routed
> to go out on eth1, and then when it comes back in through eth2, then
> it must go out on eth3.
>
> And also vice versa, that is all ip that comes in on eth3 and is
> destined for 192.168.x.x, to go out on eth2, come in again on eth1 and
> finally leaves via eth0.
>
> How to do this?
> Any hints appreciated.


So that would be:

|-------------------------------------------|
192.168.0.0 |eth0/192.168.0.1 eth3/172.16.0.1| 172.16.0.0
-------------|----> | |------>---- |-------------
| | | |
| |eth1 |eth2 |
| |10.10.0.1 |10.10.0.2 |
|-------------------------------------------|
| |
| |
V |
|-->-- crossed UTP -->--|



Gr, Hans


 
Reply With Quote
 
frank19991@hotmail.com
Guest
Posts: n/a

 
      05-07-2004, 02:36 PM

Hi, Hans,

Looks like I have similar question as yours (see my post today). It seems
NAT (Network Address Translation) may do that. I found some links.
Haven't tried yet. Let me if you have any luck with them:

http://computer.howstuffworks.com/nat1.htm

http://groups.google.de/groups?hl=de...=3D88217A.6070
702%40candelatech.com&rnum=27&prev=/groups%3Fq%3DGreear%2BBen%26start%3D20%26hl%
3Dde%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26as_drrb%3Db%26as_mind%3D12%26as_minm%3D
5%26as_miny%3D2001%26as_maxd%3D7%26as_maxm%3D5%26a s_maxy%3D2004%26selm%3D3D88217
A.6070702%2540candelatech.com%26rnum%3D27

Frank

On Fri, 7 May 2004, Hans wrote:

>
> "Hans" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > Hello.
> > I have a box with 4 nic's, eth0 .. eth3;
> >
> > eth0 is on 192.168.x.x; eth1 and 2 are on 10.10.x.x; eth 3 is on
> > 172.16.x.x
> > eth1 and eth2 are connected to eachother by a crossed UTP-cable.
> >
> > What I want is that all incoming traffic on eth0 that is destined for
> > 172.16.x.x, to be rerouted NOT immediately to eth3, but to be routed
> > to go out on eth1, and then when it comes back in through eth2, then
> > it must go out on eth3.
> >
> > And also vice versa, that is all ip that comes in on eth3 and is
> > destined for 192.168.x.x, to go out on eth2, come in again on eth1 and
> > finally leaves via eth0.
> >
> > How to do this?
> > Any hints appreciated.

>
> So that would be:
>
> |-------------------------------------------|
> 192.168.0.0 |eth0/192.168.0.1 eth3/172.16.0.1| 172.16.0.0
> -------------|----> | |------>---- |-------------
> | | | |
> | |eth1 |eth2 |
> | |10.10.0.1 |10.10.0.2 |
> |-------------------------------------------|
> | |
> | |
> V |
> |-->-- crossed UTP -->--|
>
>
>
> Gr, Hans
>
>
>

 
Reply With Quote
 
Toni Erdmann
Guest
Posts: n/a

 
      05-07-2004, 03:22 PM
Hans wrote:

> "Hans" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
>
>>Hello.
>>I have a box with 4 nic's, eth0 .. eth3;
>>
>>eth0 is on 192.168.x.x; eth1 and 2 are on 10.10.x.x; eth 3 is on
>>172.16.x.x
>>eth1 and eth2 are connected to eachother by a crossed UTP-cable.
>>
>>What I want is that all incoming traffic on eth0 that is destined for
>>172.16.x.x, to be rerouted NOT immediately to eth3, but to be routed
>>to go out on eth1, and then when it comes back in through eth2, then
>>it must go out on eth3.
>>
>>And also vice versa, that is all ip that comes in on eth3 and is
>>destined for 192.168.x.x, to go out on eth2, come in again on eth1 and
>>finally leaves via eth0.
>>
>>How to do this?
>>Any hints appreciated.

>
>
> So that would be:
>
> |-------------------------------------------|
> 192.168.0.0 |eth0/192.168.0.1 eth3/172.16.0.1| 172.16.0.0
> -------------|----> | |------>---- |-------------
> | | | |
> | |eth1 |eth2 |
> | |10.10.0.1 |10.10.0.2 |
> |-------------------------------------------|
> | |
> | |
> V |
> |-->-- crossed UTP -->--|
>


I guess, the IP header must not be modified in your case here
(as NAT would do).

I'm not sure, but some time ago I read something about
'iptables can set a mark on incoming packets' and
'route can make routing decisions based on marks set by iptables'

iptables -t mangle -A PREROUTING -i eth0 -??? -mark 1
iptables -t mangle -A PREROUTING -i eth3 -??? -mark 2

route ... ??? marked 1 dev eth1
route ... ??? marked 2 dev eth2

takes these as examples, they are not correct though.

Toni
 
Reply With Quote
 
Toni Erdmann
Guest
Posts: n/a

 
      05-07-2004, 03:35 PM
Toni Erdmann wrote:

> Hans wrote:
>
>> "Hans" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed) om...
>>
>>> Hello.
>>> I have a box with 4 nic's, eth0 .. eth3;
>>>
>>> eth0 is on 192.168.x.x; eth1 and 2 are on 10.10.x.x; eth 3 is on
>>> 172.16.x.x
>>> eth1 and eth2 are connected to eachother by a crossed UTP-cable.
>>>
>>> What I want is that all incoming traffic on eth0 that is destined for
>>> 172.16.x.x, to be rerouted NOT immediately to eth3, but to be routed
>>> to go out on eth1, and then when it comes back in through eth2, then
>>> it must go out on eth3.
>>>
>>> And also vice versa, that is all ip that comes in on eth3 and is
>>> destined for 192.168.x.x, to go out on eth2, come in again on eth1 and
>>> finally leaves via eth0.
>>>
>>> How to do this?
>>> Any hints appreciated.

>>
>>
>>
>> So that would be:
>>
>> |-------------------------------------------|
>> 192.168.0.0 |eth0/192.168.0.1 eth3/172.16.0.1| 172.16.0.0
>> -------------|----> | |------>---- |-------------
>> | | | |
>> | |eth1 |eth2 |
>> | |10.10.0.1 |10.10.0.2 |
>> |-------------------------------------------|
>> | |
>> | |
>> V |
>> |-->-- crossed UTP -->--|
>>

>
> I guess, the IP header must not be modified in your case here
> (as NAT would do).
>
> I'm not sure, but some time ago I read something about
> 'iptables can set a mark on incoming packets' and
> 'route can make routing decisions based on marks set by iptables'
>
> iptables -t mangle -A PREROUTING -i eth0 -??? -mark 1
> iptables -t mangle -A PREROUTING -i eth3 -??? -mark 2
>
> route ... ??? marked 1 dev eth1
> route ... ??? marked 2 dev eth2
>
> takes these as examples, they are not correct though.


more correct:

/sbin/iptables -t mangle -A PREROUTING -i eth0 -j MARK --set-mark 1
/sbin/iptables -t mangle -A PREROUTING -i eth3 -j MARK --set-mark 2

/sbin/ip rule add fwmark 1 table toeth1
/sbin/ip rule add fwmark 2 table toeth2

/sbin/ip route add default via ????? dev eth1 table toeth1
/sbin/ip route add default via ????? dev eth2 table toeth2

I saw something like this in

/usr/share/doc/howto/en/html/Adv-Routing-HOWTO/lartc.netfilter.html

on a SuSe Linux 9.0 (i guess)

HTH, and please let me know

Toni
 
Reply With Quote
 
jack
Guest
Posts: n/a

 
      05-08-2004, 12:45 AM
Hans wrote:
> "Hans" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
>
>>Hello.
>>I have a box with 4 nic's, eth0 .. eth3;
>>
>>eth0 is on 192.168.x.x; eth1 and 2 are on 10.10.x.x; eth 3 is on
>>172.16.x.x
>>eth1 and eth2 are connected to eachother by a crossed UTP-cable.
>>
>>What I want is that all incoming traffic on eth0 that is destined for
>>172.16.x.x, to be rerouted NOT immediately to eth3, but to be routed
>>to go out on eth1, and then when it comes back in through eth2, then
>>it must go out on eth3.
>>
>>And also vice versa, that is all ip that comes in on eth3 and is
>>destined for 192.168.x.x, to go out on eth2, come in again on eth1 and
>>finally leaves via eth0.
>>
>>How to do this?
>>Any hints appreciated.

>
>
> So that would be:
>
> |-------------------------------------------|
> 192.168.0.0 |eth0/192.168.0.1 eth3/172.16.0.1| 172.16.0.0
> -------------|----> | |------>---- |-------------
> | | | |
> | |eth1 |eth2 |
> | |10.10.0.1 |10.10.0.2 |
> |-------------------------------------------|
> | |
> | |
> V |
> |-->-- crossed UTP -->--|


What exactly is THIS ---- UP THERE ---- good for...?

Anyways, Toni gave hints already, but in this configuration of Yours,
I'll doubt hat those work.

It would be of great help if You could tell us what You want to do.
Good news: It is possible, but it will require some tweaks.


Cheers, Jack.

--
----------------------------------------------------------------------
My personal reading of the string "MicroSoft" expands to "NanoWeak"...
 
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
Advanced routing, two ISP's Dariusz Malec Linux Networking 4 05-16-2010 10:18 AM
Need Help from Advanced IP Routing Tech razor Windows Networking 5 08-01-2007 01:35 PM
Advanced routing Tomasz Plebanski Linux Networking 2 12-15-2004 03:42 PM
Advanced routing: multiple FIREWALLED IPs Rudolf Potucek Linux Networking 1 06-03-2004 08:43 PM
advanced routing Henrik Gram Linux Networking 2 09-14-2003 02:58 AM



1 2 3 4 5 6 7 8 9 10 11