Target ROUTE
i need all my network trafic to any host on 995 port goes to another gateway then the default. So i execute the following iptables command:
iptables -t mangle -A OUTPUT -p tcp --dport 995 -j ROUTE --gw x.x.x.x
where x.x.x.x is my another gateway .
The problem when i execute the iptables command above is this:
iptables: No chain/target/match by that name
thanks a lot
Júlio César de Magalhães
Analista de Suporte - Poliedro/FNDE
(61) 81177547 Brasília - DF
That means your kernel or/AND iptables doesnt have the ROUTE target
compiled and ready for use.
Try the command: iptables -j ROUTE --help
If ROUTE target is compiled, you should see something like this:
ROUTE target v1.8 options:
--oif ifname Route the packet through `ifname' network
interface
--iif ifname Change the packet's incoming interface to
`ifname'
--gw ip Route the packet via this gateway
--continue Route the packet and continue traversing the
rules. Not valid with --iif.
on the end of the help message. If you see only the iptables help, that
means ROUTE is really not compiled.
If that's the case, you'll need to get a patch-o-matic file, apply ROUTE
patch on your kernel source, recompile and install the new kernel and probably recompile iptables also.
Sincerily,
Leonardo Rodrigues
----- Original Message ----- From: "Júlio César de Magalhães" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 05, 2005 8:23 AM
Subject: Target ROUTE
i need all my network trafic to any host on 995 port goes to another gateway then the default. So i execute the following iptables command:
iptables -t mangle -A OUTPUT -p tcp --dport 995 -j ROUTE --gw x.x.x.x
where x.x.x.x is my another gateway .
The problem when i execute the iptables command above is this:
iptables: No chain/target/match by that name
thanks a lot
Júlio César de Magalhães
Analista de Suporte - Poliedro/FNDE
(61) 81177547 Brasília - DF
Or just use de MARK target and use iproute2 to route by mark.
[]'s
Em Quarta 05 Janeiro 2005 10:31, Leonardo Rodrigues Magalhães escreveu:
Quoted 48 lines
That means your kernel or/AND iptables doesnt have the ROUTE target
compiled and ready for use.Try the command: iptables -j ROUTE --help
If ROUTE target is compiled, you should see something like this:
ROUTE target v1.8 options:
--oif ifname Route the packet through `ifname' network
interface
--iif ifname Change the packet's incoming interface to
`ifname'
--gw ip Route the packet via this gateway
--continue Route the packet and continue traversing
the rules. Not valid with --iif.on the end of the help message. If you see only the iptables help, that
means ROUTE is really not compiled.If that's the case, you'll need to get a patch-o-matic file, apply
ROUTE patch on your kernel source, recompile and install the new kernel and probably recompile iptables also.Sincerily,
Leonardo Rodrigues----- Original Message -----
From: "Júlio César de Magalhães" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 05, 2005 8:23 AM
Subject: Target ROUTEi need all my network trafic to any host on 995 port goes to another gateway then the default. So i execute the following iptables command:
iptables -t mangle -A OUTPUT -p tcp --dport 995 -j ROUTE --gw x.x.x.x where x.x.x.x is my another gateway .The problem when i execute the iptables command above is this:
iptables: No chain/target/match by that namethanks a lot
Júlio César de Magalhães
Analista de Suporte - Poliedro/FNDE
(61) 81177547 Brasília - DF
Signature · 10 lines
Mateus Cordeiro Inssa -------------------------------------- Linux User: 76186 Kernel: 2.6.10-rc2mateus ICQ (Kopete): 15243895 AIM: blaublaux MSN: [email protected] -------------------------------------- [email protected] Qua Jan 5 10:22:08 BRST 2005
why not using MARKing feature of iptables and then route the marked packet via iproute2 like...
#iptables -A PREROUTING -i eth0 -t mangle -p tcp --dport 995 -j MARK --set-mark 4
this is iproute2 part
ip rule add fwmark 4 table another.out
ip route add default via $GATEWAY dev eth0 table another.out ip route flush cache
regards
Quoted 14 lines · Júlio César de Magalhães
i need all my network trafic to any host on 995 port goes to another gateway then the default. So i execute the following iptables command:
iptables -t mangle -A OUTPUT -p tcp --dport 995 -j ROUTE --gw x.x.x.x
where x.x.x.x is my another gateway .The problem when i execute the iptables command above is this:
iptables: No chain/target/match by that namethanks a lot
Júlio César de Magalhães
Analista de Suporte - Poliedro/FNDE
(61) 81177547 Brasília - DF
Signature · 2 lines
(after bouncing head on desk for days trying to get mine working, I'll make your life a little easier)