IP traffic rerouting
Hi,
is there a solution to reroute all traffic (icmp, udp, tcp, ...) from one IP address to another one?
I know xinetd can do this but that's only for tcp and for a specific port. I'm looking for a global solution -if any-
Regards
Signature · 4 lines
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
Quoted 3 lines · Daniel Huhardeaux
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
Quoted 1 line
= 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.)
Quoted 9 lines · Jan Engelhardt
Quoted 3 lines · Daniel Huhardeaux
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
Quoted 8 lines
Quoted 2 lines
= 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
Signature · 9 lines
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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html