Re: How to redirect the package from eth0 to eth2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Anno domini 2011 Roc Bai scripsit:

Hi!

> Dear all:
>     in my service, there are four net card.  eth0, eth1, eth2, eth3. I
> want to forward the data in from eth0 to eth1, eth2, eth3 with
> different application protocol. Does some body send me some ideas on
> it?

So you want to route (as in IP routing) packages to different hosts
based on protocols (as in IP, GRE, etc?) or tcp/udp ports? Is this
correct?

>    1) where i should set the hook: pre-routing or forward?
>    2) how to make the route select the target port which i hope?

If you want to re-route packages, that has to happen in pre-routing.
If you want to use DNAT for examples, just add a rule to the
PREROUTING chain in the nat table.
If you want to use real routing, there should be multiple ways to
accomplish that. I'm not sure which one is the preferred now adays.
(mark packages and us 'ip rule' and multiple routing tables, ROUTE
target, ...)

>    3) where i can get some simple source code to learn?

Source code of what?

Maybe you can say a bit more about what you exactly want to do?

Ciao
Max
-- 
The real problem with C++ for kernel modules is:
the language just sucks.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux