(E-Mail Removed) a écrit :
>>
>>>On the linux box I want to redirect incoming traffic from 192.168.1.202
>>>to be routed through the trendnet router (192.168.1.100) back into the
>>>internet so both connections can be used.
>>
>>Can't you do it on the server directly ?
>
> How would I do that? In what stage of the packet filter process should
> I mark the packets? On the router I mark them in the mangle table in
> the PREROUTING chain,
What iptables rule did you use to mark the packets ?
I think you don't need marks. You can just use a source-based routing
policy instead (ip rule from) :
ip rule add from 192.168.1.202 table 7
ip route add default via 192.168.1.100 table 7
By the way, on your Linux gateway, did you make sure that :
- iptables rules in the FORWARD chain accept packets from the server to
the other router which enter and leave on the same interface ?
- there is no NAT on the path of packets redirected from the server to
the other router ?
> but when would I mark them on the server? After
> that, would the same ip route rule work, or would it be changed?
You don't need marks, as above. In the server's advanced routing :
ip rule add from 192.168.1.202 table 7
# alternate default gateway
ip route add default via 192.168.1.100 table 7
# needed if 192.168.1.202 may be used on the LAN
# this is a copy of the subnet route in the main routing table
ip route add 192.168.1.0/24 dev <ethX> table 7
Alternatively, you can use the MARK target in the mangle OUTPUT chain
and fwmark in ip rule as you did on the gateway.