Originally Posted by dansif
This simply does not give enough information. What is in table1 and table2? What kind of tables are table1 and table2? Where do you do the routing (I use IPTables)? Pre-routing, post-routing, forward? Please give me a little more information.
Table1 & Table2 are the arbitirary tables which can be replaced by any numeric nos less than 253 or if you want to refer them by any name then you got to edit /etc/iproute2/rt_tables to mention a table name & a numeric id (<253).
I'll give you a broader picture of the overall concept.
We use SQUID to generate packets get out with specific source IPs(on basis on clientsets).
And then as we have packets for which we know the source ip & hence we do source ip based routing.
Now we use ip rule
to create rules so that this source ip based routing could be implemented.
ip rule from YOUR-SOURCE-IP1 table 200
ip rule from YOUR-SOUCE-IP2 table 201
will act like if then condition rules.
So ip rule
stand prior to the routing decision part & then ip rule fetch packets into different routing tables(with numeric ids)
Now you'll ask about how are these routing tables are different from the rest & how do we specify them.
ip rou add default via gateway1 table 200
ip rou add default via gateway2 table 201
So in one way we organize packtes & then after finding out where to forward these packets (from ip rule command) we forward them to tables(routes) which process them prior to the default routes.
With squid we generated a packet to get out with source ip of 184.108.40.206; then the next thing will the decision taken by ip rule entries. ip rule will determine that we got to forward packets with these source ip to table 101(arbit) & then table 101 has some route; with which these packets get traverse & goes OUT.
We dont use IPTABLES in it.