It is difficult, we have two cats who are 19 & 16 yrs, they hate the dogs but the dogs love the cats and want to play and chase them but obviously the cats will have none of it, they hiss and scratch the dogs if they get too close.
We have a stair gate between the living room and the dining room, the cats get to sleep in the dining room out the way of the dogs. Should the cats jump over the gate the dogs get excited but with a firm "NO! on your bed", they do stay their distance until we can escort the cat out.
It is a pain, but with my two cats being old and the dogs being young they just don't mix.