Two-way NAT routing
Hello,
I have network like that: (CLIENT1) (CLIENT2) ((( MY ROUTER))) (Gateway-192.168.0.1) (Gateway-192.168.0.2) Client 1 and 2 now is using an internet connection with iptables NAT from gateway-1. But the main idea is to make some ports (ex.6667) from client1 to be forwarded to gateway2's internet connection. How I can do that? |
Depends... Are you saying that your router is the gateway with both IP addresses bound to a single or multiple interfaces, or are you saying that your router is a separate entity from the two gateways?
If your router is the gateway with two IP addresses you can use "iptables -j SNAT" to define what traffic leaves what IP. If your router sends traffic to one of two external gateways you are looking at policy routing. |
The gateways is another computers on another interfaces
|
This means you will need to do policy routing. I recommend using the firewall mark in iptables and routing packets based on this mark.
Here is a good reference site: http://www.compendium.com.ar/policy-routing.txt Section 6 talks about the fwmark method. Another good resource I found on Google: http://www.monkeynoodle.org/comp/net...ing-HOWTO.html Hope this helps :) |
All times are GMT -5. The time now is 02:25 PM. |