Hello OpenWRT community,
Before I go to the question, let me describe my use case first. I'm using prebuilt KVM virtual machines with OpenWRT for the sole purpose of doing one-to-one static NAT between networks.
I don't need any other functionality, so I have disabled dhcpd, dnsmasq, httpd and firewall services by renaming files 'dhcp', 'firewall', 'luci' and 'uhttpd' in /etc/config and files 'S35odhcpd' and 'S60dnsmasq' in /etc/rc.d with prefix "INVALID".
I'm using quite an old version of OpenWRT right now (15.05.1) as it fully suits my needs, but of course I can upgrade if needed.
The sample iptables configuration I'm using looks like this:
-A PREROUTING -s 192.168.200.1/32 -d 10.90.0.0/16 -j NETMAP --to 10.10.0.0/16
-A POSTROUTING -s 192.168.200.1/32 -d 10.10.0.0/16 -j MASQUERADE
-A PREROUTING -s 10.10.0.0/16 -d 10.10.0.100/32 -j DNAT --to-destination 192.168.200.1
-A POSTROUTING -s 10.10.0.0/16 -d 192.168.200.1/32 -j NETMAP --to 10.90.0.0/16
The machine has one interface with the IP address 192.168.200.100 and another one with 10.10.0.100 (in fact, it has more interfaces, but they all follow the same rule). The goal is to allow the server that sits under the address 192.168.200.1 to access the network 10.10.0.0/16 as if it were 10.90.0.0/16, and vice versa - the machines in network 10.10.0.0/16 to access the server 192.168.200.1 as if it were 10.10.0.100. The reason for this is that we can't - due to some restrictions - change the configurations of the machines in network 10.10.0.0/16, the server address 10.10.0.100 is fixed and preconfigured on these machines, and the server is already connected (via another interface) to another similar network with address space 10.10.0.0/16. So we let the server access the second network as 10.90.0.0/16, while keeping the network actually configured as 10.10.0.0/16.
Until now, everything works well. But let's go on to the question. We need to add the functionality to network boot some machines in the NATed network via PXE. But the server that will be providing DHCP and boot images is - of course - the server at 192.168.200.1.
Is it possible to add some DHCP-Relay to the configuration to make this work over NAT?