Router Interfaces Need Separate Subnets

Router interfaces must be assigned IP addresses that are on separate subnets. This is because each interface represents a distinct broadcast domain and each router interface acts as a default gateway for the subnet it serves. Assigning IP addresses from the same subnet to multiple interfaces on a router creates ambiguity in routing and in the routing table since the router will be unable to distinguish which interface should handle traffic for that subnet.

This undermines proper packet forwarding and can lead to routing conflicts or errors. By assigning unique subnets to each interface, the router can maintain clear boundaries between network segments, enabling proper routing of traffic.

Most routers won't allow you to assign an IP address to an interface if it is within the range of a subnet that is already assigned to another interface. For example, Cisco IOS lets you configure it but won't allow you to enable the interface:

R1(config)#interface Ethernet0/1 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown R1(config)#interface Ethernet0/2 R1(config-if)#ip address 192.168.12.1 255.255.255.0 R1(config-if)#no shutdown % 192.168.12.0 overlaps with Ethernet0/1 Ethernet0/2: incorrect IP address assignment

There is an exception to this rule, when you use a VRF. This means you'll have multiple separate routing tables on a router.

https://networklessons.com/switching/broadcast-domain