I'm having two private LANs on different subnets, e.g. 192.168.100.0/24 and 192.168.200.0/24. Both of these LANs are on DHCP. Inbetween them there is a (Linux) server connected to both of them on different interfaces, e.g. eth0 and wlan0.
Hosts on both subnets are allowed to communicated within and across both LANs which works perfectly well when using IP addresses. Within one of the LANs communication between hosts works fine based on local hostnames. What doesn't work across the two LANs is name resolution.
Example: if I want to reach a host on the other LAN I can successfully do ping 192.168.100.33
but not ping MediaServer
. If I'm sitting on the same LAN then both work fine.
Both LANs are quite heterogeneous with e.g. PCs, Laptops, Printers, NAS, Mediaserver, Smartphones, etc. and changing (therefore DHCP).
I searched for quite some time (but I'm still new to this topic) and think this is done on NetBios, WINS. I tried a lot with forwarding (like the example below; ferm syntax for iptables) but that all didn't help unfortunately.
interface eth0 protocol udp dport 137 mod addrtype dst-type BROADCAST DNAT to 192.168.200.255;
interface wlan0 protocol udp dport 137 mod addrtype dst-type BROADCAST DNAT to 192.168.100.255;
I'm stuck right now probably because I'm missing something important or misunderstand something. Any hints and tips are highly appreciated!