That is possible with the help of VLANs and iptables/tc.
First you must to separate your LAN ports to different VLANs - otherwise you can't tell which LAN port the traffic is coming from. Then you'll have a bunch of new VLAN interfaces (e.g., eth0.1, eth0.2 and so on) instead of the original LAN interface (eth0 in this case). This can be done using /etc/config/network, vconfig and ifconfig.
iptables is capable of MARK'ing packets based on the interface where they're coming from. (You can also match different ports, source/dest addresses, application layer stuff (with layer7 module) just to mention a few.)
For example you can set (internal) priority of 1 to TCP packets that are coming from eth0.2, and prio 2 for eth0.3 packets:
iptables -t mangle -A PREROUTING -i eth0.2 -p tcp -j MARK --set-mark 1
iptables -t mangle -A PREROUTING -i eth0.3 -p tcp -j MARK --set-mark 2
Then you can use tc to filter packets to different QoS classes using those priority marks:
(note that you must have your QoS rules set up before filtering... see LARTC below)
...
tc filter add dev $WAN_IF parent X:Y protocol ip prio 1 handle 1 fw classid Z:AA
tc filter add dev $WAN_IF parent X:Y protocol ip prio 2 handle 2 fw classid Z:BB
...
Internet is full of manuals and guides for iptables and there's also lots of material about tc and Linux specific and generic traffic shaping (that's what you are doing here).
Good but a bit old guide is Linux Advanced Routing & Traffic Control HOWTO (http://lartc.org/). Nice site about iptables is at http://www.linuxtopia.org/Linux_Firewal … index.html .
HTH
--
kurkku