Thank you very much. I added a similar script in /jffs/scripts/wan-start.
I tried to check whether the rules had been applied using "iptables -t nat -L", but couldn't see anything related to marking packets.
And I also tried to run a traceroute from the router, all hits went through wan1_gateway.