is it possible to use same subnets on router/AP interfaces?
I have two RB433AH boards with R52n cards and I’m using them for point to point wireless link. I have two laptops at each end of the link and laptops have to be able to talk to each other. Wlan interfaces obviously have to be on the same subnet, but what about the ethernet interfaces? I’ve tried to set the network (4 laptops, AP and station) on the same subnet, but with no success. I had following setting in mind:
Laptop 3 (connected to station) = 10.1.3.31/24
Laptop 4 (connected to station) = 10.1.3.41/24
Is this possible? I’ve read in several places that a router should have different subnets on each interface but I haven’t been able to find any explanation why this would be so.
While it’s possible, it is significantly easier to just use different networks.
Clients on networks essentially make very simple routing decisions: is the destination address on my own network? If yes, let me find out the MAC address of the destination IP via ARP, and then send the traffic directly to it. If no, let me find out the MAC address of my default gateway via ARP, and then send the traffic directly to it. That default gateway is a router, which can make smarter routing decisions and choose an interface to send the traffic out of.
Now imagine a client behind ether0 on router 1 having to talk to a client behind ether0 on router 2. If the clients behind router 2 are on the same IP space, the clients behind router 1 don’t know to go through the router to get there - they see that they are to request a resource from IP space that they themselves are on, so they try to contact the resource themselves, which is of course impossible.
You can use the same IP address space and NAT it on each side. Clients behind router 1 and router 1 itself would think clients behind router 2 really have completely addresses than they actually do. Then those addresses would be on a different network and the clients would forward to the router, and the router to the other router. Of course router 1 would then also have to rewrite the source address of the client request, because router 2 and clients behind router 2 must be made to think that clients behind router 1 have different addresses from what they actually do because the client would see request traffic to come from its own network and would send the reply to the wrong machine (and the router might, if programmed properly, refuse to accept packets from a directly connected network coming into an interface the directly connected network isn’t on, as that would usually be considered IP spoofing).
So, long story short, don’t use the same address space whenever you don’t absolutely have to. The NAT scenario I described sometimes comes up when two companies merge, need to merge networks that already have overlapping IP space and for some reason neither company can change the IP space used. It’s a real pain and not something you’d want to introduce if you can somehow avoid it.