Re: IP traffic rerouting

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

 



Jan Engelhardt a écrit :
On Friday 2009-08-14 00:44, Daniel Huhardeaux wrote:
is there a solution to reroute all traffic (icmp, udp, tcp, ...) from
one IP address to another one?


Routing tables are controlled with iproute2. Replace the variables by something appropriate. The freely choosable $number usually wants to be
= 1 to avoid surprises.

ip rule add from $srcaddr table $number prio $prio
ip route add default via $toaddr table $number

(The main routing table has number 254, and is usually at the lowest prio of 32767. The "prio $prio" part is thus usually optional in practice.)
Thanks for your answer Jan.

This means that if I want to redirect all traffic to an IP to another one, and changing the sorce address as if packet came from the IP from redirected machine I would have to create:

ip rule add to $iptoredirect table $number prio $prio
ip route add default via $toaddr src $iptoredirect table $number

Without changing the source address it would be:

ip rule add to $iptoredirect table $number prio $prio
ip route add default via $toaddr table $number

Would be the NAT option not a possibility? Something like

ip route add nat $iptoredirect via $toaddr

Regards

--
Daniel Huhardeaux       _____ ____ ____ _____ _____ _
enum   +33 368 460 088 (_  __) _  ) _  (_  __) _  _(_)  +48 222 472 472
iaxtel  1-700-849-6983  / / / // / // / / / / /_/ / /  GIZMO,SKYPE,GTALK
sip/iax:callto 101@sip./_/ ( ___( ___/ /_/ (_/ (_/_/.net   tootaiNET

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux