Re: A weird routing question.



Pascal Hambourg wrote:
Hello,

Ken Sims a écrit :

On Thu, 27 Sep 2007 19:36:35 +0200, none <""testr\"@(none)"> wrote:

On a linux box 'A' which has interfaces eth0, eth1, eth2, eth3, I would
like to do a special treatment on packets incoming via eth0 and whose
source is <some-network>.

I would like these packets be unconditionaly redirected unmodified for
output via interface eth1.

That is:
- even if they were targeted (destination IP) at my box 'A', they will
be re-emitted through eth1.
- even if they would have been forwarded through eth2 or eth3, they
will be re-emitted through eth1 too.

If they would be forwarded anyway, advanced routing can be used to
force them out a specific interface.

Yes.

For packets whose destination is 'A', I think you would need to do
something with netfilter to get the packets on to the forwarding
chain, but I don't know how without changing the destination IP
address.

I feared that exact same thing: AFAIK choosing an output interface
implied doing some kind of DNAT.


The highly controversial ROUTE target, which allows to override the
routing decision, may help :

This option adds a `ROUTE' target, which enables you to setup unusual
routes. For example, the ROUTE lets you route a received packet through
an interface or towards a host, even if the regular destination of the
packet is the router itself.

I'had never heard of the ROUTE target. I thank you for having pinpoint that.

Anyone here can easily understand why such a target is controversial: it
reverts the stages in packets processing because we usually infer the
appropriate route from the expected destination IP. Furthermore, to set
up a specific routing policy for some traffic that hit a particular
input interface hurts our mind a bit.

It's even more strange when we consider my case because it bring us four
questions:
- 1) Why would someone 'reflect'-out some ingoing traffic targeted at
its workstation?
- 2) Will these packets eventually reach the expected target. (Answer:
YES, though through traffic shaping or accountancy on some other host
for example)
- 3) Will these packets be MANGLED on their way (i.e. using some kind
of NAT) or just be re-transmitted unaltered? (Tied with question 4)
- 4) What becomes of reply packets?

For question 3, I think transmitting packets unaltered allows me to
avoid having some other host on the network: NAT, thus mangling, would
imply forward to a well known router IP.

For question 4, I fear transmitting packets unaltered will imply
different routes for both directions of udp/tcp flows, which would cause
trouble if host 'A' serves as a gateway for some other network,
especially regarding FTP and internet telephony which involve special
connection tracking and NAT mechanisms. Achieving my goal with NAT, and
thus with the aid of some other host (router) B, would be a better
approach then.

Any comments are welcome.

Sincerely,
Le Testeur
.



Relevant Pages

  • Re: Cant ping router.
    ... Ping 192.168.0.1: 56 data bytes ... ping: send: Host is down ... packets transmitted, 0 packets received, 100% packet loss ... the 'route change' command I gave you explicitly disables ...
    (comp.sys.acorn.networking)
  • Re: What is a default route??
    ... lines run to two different ISPs. ... By "bonding" the NICs the OP could have automatic failover (another ... two route paths. ... route related packets out one interface and other related packets out ...
    (comp.os.linux.networking)
  • VxWorks call Ping () to Unreachable host goes into an infinite loop
    ... am getting following issues in ping call of VxWorks. ... ROUTE NET TABLE ... Reachable Host 10.1.1.23 5 packets and debug option enabled. ...
    (comp.os.vxworks)
  • Re: resolving routes externally
    ... > userland daemon capable of resolving those complex addresses (the ... > userland daemon is looking up the route. ... you want the kernel to queue packets until ... The ARP code implements a queue for each IP host address which is ...
    (freebsd-hackers)
  • Re: resolving routes externally
    ... > userland daemon capable of resolving those complex addresses (the ... > userland daemon is looking up the route. ... you want the kernel to queue packets until ... The ARP code implements a queue for each IP host address which is ...
    (freebsd-net)