I'm trying to find out if it's possible to route based on current bandwidth consumption. I have a linux router connected to three networks:
- internal lan (eth1)
- 4mb/512kb cable connection (eth2)
- 3mb/3mb dual T1 connection (eth3).
Currently all unmarked traffic gets NAT'd and goes out eth2 (cable). I can mark traffic with iptables and force it to get NAT'd and go out eth3 (T1s). I also have a public /27 that gets routed directly out eth3 (T1s).
I just started messing around with TC to shape the outgoing bandwidth on eth2 (cable) since it has such little outgoing bandwidth. I'd like to be able to force all (NAT'd) traffic out eth2 (cable) until that link is maxed out and then let addition connections go out eth3 (T1s).
I'm aware I can load balance with iproute2 based on a weight, but I'd rather let the cable connection get consumed first and leave the T1s open for our server traffic.
Does anyone know if this is possible?
I've read the incredibly confusing howto docs on lartc.org and in the section on ingress policing they talk about overlimits, which is in the right neighborhood: http://lartc.org/howto/lartc.adv-filter.policing.html
I guess my real question is, is it possible to mark traffic using the TC commmand like I can with iproute2? Or can I send packets that come in on one interface to a TC qdisc on another interface?