There are two ways to achieve this. The first is very abnormal and likely to cause weirdness, so the second is better.
Method 1 (NOT recommended)
The typical routing table looks something like this:
% ip route
10.23.11.0/24 dev wlan0 proto kernel scope link src 10.23.11.209
default via 10.23.11.1 dev wlan0 proto static
Which tells the kernel that destinations in 10.23.11.0/24 are directly connected to wlan0, and everything else must go via the router at 10.23.11.1. It's this first route which tells the kernel to do an ARP request and send the packet directly. If you remove it then everything should go via the router. This route is configured by default though, so you'll need to explicitly remove it somewhere. Your eventual routing table should look something like this:
% ip route
default via 10.23.11.1 dev wlan0 proto static
Method 2 (recommended)
The better method is to place each machine on its own subnet, so that each subnet is an Ethernet domain (as it usually should be). You would do this by allocating each machine a /30 subnet, with the router taking one of those IPs. Your network would look something like this:
(machine1) 10.0.0.2/30 <-------> 10.0.0.1/30 (router) 10.0.0.5/30 <--------> 10.0.0.6/30 (machine2)