Hi,<br><br>I've done some work on this a few month ago at my other job, and basically<br>the solution lies in iproute2 commands.<br><br>First you need to create a rule and assign that traffic to a different table<br>than the main table. Then you can easily add a default route to that new
<br>table.<br><br>so it would look like this<br><br>ip rule add from <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://192.168.1.0/24" target="_blank">192.168.1.0/24</a> table X<br><br>check /etc/iproute2/rt_tables if you want to make aliases like eth1 eth2 eth3
<br>it will get easier if you automate this thing :)<br><br>After that you set a default route to this new table.<br><br>ip route add default via <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://1.2.3.4/" target="_blank">
1.2.3.4</a> table X<br><br><br>Once you have this done and working it's a matter of getting your<br>dhclient of pppoe to do this for you as soon as ip changes.<br><br>for pppoe create a /etc/ppp/ip-up.local script.<br>for dhclient stuff you need to look in /sbin/dhclient-script script to find
<br>out how it will execute what's in /etc/dhclient-enter-hooks<br>or /etc/dhclient-exit-hooks<br><br>It's quite useful and for me it did turn out to work nicely. I just had to<br>create some sort of master script that would take decisions on what's going
<br>on with my gateways :) It was pretty fun to work on that. I hope this helps<br>you out.<br><br>Later,<br>Charles<br><br><br><div><span class="gmail_quote">On 5/26/06, <b class="gmail_sendername">Feizhou</b> <<a href="mailto:feizhou@graffiti.net">
feizhou@graffiti.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Tom Brown wrote:<br>> Hi<br>><br>> On a multihomed box how can i set different gateways for each NIC?
<br>> Setting them in the ifcfg-ethx does not seem to make any difference to<br>> the routing?<br>><br>> thanks<br>> _______________________________________________<br>> CentOS mailing list<br>> <a href="mailto:CentOS@centos.org">
CentOS@centos.org</a><br>> <a href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a><br><br>Try creating routing tables per NIC, populating those tables and<br>creating ip rules to lookup the respective table. This means you need to
<br>identify which NIC the packets belong to. You can try adding rules to<br>the mangle PREROUTING chain of netfilter to mark the packets based on<br>their source ip. Then the ip rules can instruct the kernel to lookup the
<br>proper routing table depending on the firewall mark.<br><br>man ip, man iptables, <a href="http://linux-ip.net/html/routing-tables.html">http://linux-ip.net/html/routing-tables.html</a> and<br><a href="http://linux-ip.net/html/tools-ip-route.html">
http://linux-ip.net/html/tools-ip-route.html</a><br><br>_______________________________________________<br>CentOS mailing list<br><a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br><a href="http://lists.centos.org/mailman/listinfo/centos">
http://lists.centos.org/mailman/listinfo/centos</a><br></blockquote></div><br><br clear="all"><br>-- <br>Thx<br>Joshua Gimer