I'm sure it is something that can be accomplished with a bit more detail. What is your ultimate goal? Why does 10.40.10.217 need to be its own default gateway? Is this routing for a single host?
route add -net 10.40.10.0/24 gw 10.8.10.1 dev eth0
route add 10.40.10.217/32 gw 10.40.10.217 dev eth0
(from memory, may not be 100% accurate)
I'm guessing that your system(s) are on a network that can route to 10.8.10.1 and it knows where to send 10.40.10.0/24 traffic...
Without a clearer picture of your network and/or what exactly you are after I'm hoping the information provided is helpful.