Various forms of this question have been discussed on the forum several times. A search might turn up some information that could be useful.
I believe that the most satisfactory implementations that accomplishes this is to configure Integrated Routing and Bridging on the router. Remove the IP address from the interface where it is currently assigned, configure a bridge group and assign both LAN interfaces to the bridge group, configure a BVI interface and assign the IP address to the BVI interface. With IRB spanning tree should put one of the LAN interfaces into blocking mode and will forward packets over the active interface. If there is a problem on the active interface then spanning tree will bring the other interface into active state and forward over it.
While I believe that this solution will work and will accomplish what you want, I will also observe that if it were me I am not sure that I would do it. How often is the problem in the network a bad interface on the router? (and that is what this solution protects against). If there were a problem with the one router interface, would you be able to change the connection and use the other interface? Is the benefit of automatically switching from one interface to the other worth the complexity of configuring IRB and introducing spanning tree into the convergence of your router?
We are pleased to announce availability of Beta software for 16.6.3. 16.6.3 will be the second rebuild on the 16.6 release train targeted towards Catalyst 9500/9400/9300/3850/3650 switching platforms. We are looking for early feedback from custome...