I got packet marking as described at http://lartc.org/howto/lartc.netfilter.html to work with iproute2 without too much trouble. I have two internet connections over eth1 and vlan1. eth1 is fast but occasionally drops out so I wanted to send certain traffic via vlan1 which is slower but reliable.
-- Create a new routing table and add a rule to use it for packets marked with a 1.
# mkdir /etc/iproute2
# echo 201 table1 >> /etc/iproute2/rt_tables
# ip rule add fwmark 1 table table1
# ip rule ls
0: from all lookup local
32764: from all fwmark 1 lookup table1
32766: from all lookup main
32767: from all lookup default
-- Set routes on the new table (here just a default route, probably should copy other entries from main table).
# ip route add default via 192.168.0.1 dev vlan1 table table1
# ip route list table table1
default via 192.168.0.1 dev vlan1
-- Add netfilter rules to mark packets (here on TCP 80).
# iptables -t mangle -A PREROUTING -p tcp --dport 80 -j MARK --set-mark 1
# iptables -t mangle -L PREROUTING -v
Chain PREROUTING (policy ACCEPT 5543K packets, 3265M bytes)
pkts bytes target prot opt in out source destination
20 3924 MARK tcp -- any any anywhere anywhere tcp dpt:80 MARK set 0x1
I'm by no means an expert on this, but it seems to be working for me.