Is it possible to setup a DHCP server for a static route on openwrt? I have several subnets such as 10.10.10.0/24, 10.10.20.0/24, 10.10.30.0/24, etc, that route to the internet and back to the switch using an uplink. The link's subnet is 10.10.90.0/24 so the only connection between the switch and openwrt is 10.10.90.10 & 12. I have an internal dhcp but would like to use the openwrt router to offload some of the traffic. Is it possible and does anyone know how to do it?
Based on your topic title, no it's not (at least not without extremely advanced techniques)... but it would be helpful to better understand your topology.
Basically, a static route informs the router about how to reach another network by providing it the IP address of the router that is the gateway to said network. However, that means that the network in question is not actually connected at L2 to the router that contains the static routes. DHCP operates at layer 2, so generally speaking it's not possible to serve DHCP to a network that is not directly attached to the router.
However, it is possible that your description and/or title aren't really representative of your question...
Could you draw a topology diagram... please show each router and where each subnet is configured (i.e. which router is directly connected/controlling the network) and from where you want to serve DHCP?
The DHCP implications usually starts at Layer 3 - but that is a discussion for another time. Here is the topology of the part of the network I am inquiring about. The portion of the network I am working on had a router connected to an L3 switch. The switch was doing the routing for the network, however there are some issues with the DHCP server on the L3 switch that are being addressed by the vendor. I added the Openwrt box and the routing is as follows: The Openwrt are 2 interfaces - the LINK (10.10.90.10) and the WAN, which is a public IP address. There are several static routes on the Openwrt router which I will show later
the L3 switch has multiple networks and they are routed by the switch. I thought I would move the DHCP services to the Openwrt box for these 3 networks - 10.10.10.0/24, 10.10.20.0/24, and 10.10.30.0/24. So here is the setup:
ROUTER (OPENWRT) L3 SWITCH
WAN - xxx.xxx.xxx (eth0)
Static Routes
10.10.10.0/24
10.10.20.0/24 --> LINK 10.10.90.10 (eth1) --> 10.10.90.12 --> networks on switch
10.10.30.0/24
I hope this is understandable. The Static Routes on openwrt are routing through the LINK interface to the L3 Switch and then to the networks on the switch.
I realize it's a stretch to make this work, but if the vendor doesn't correct the issues with DHCP, I need another plan. Totally reconfiguring the system is a last resort.
Well, kind of... it starts typically with a layer 3 interface, but it needs to have MAC address visibility which is L2. So without special techniques, a DHCP server on an entirely different network segment cannot serve DHCP to that other subnet.
But all of that said, is it possible to actually give your OpenWrt router an address on that network? If the network is actually managed by an L3 capable switch, you should be able to map the port (connecting OpenWrt) on that VLAN and then you can easily turn on a DHCP server.
Otherwise, you'll need DHCP relay (which does get into more advanced territory... my guess is that you're up for that, though, if you have an L3 switch!)
My apologies.... I'm about to head home to a continuing power outage and I may not be able to continue to assist (no power, totally useless cell coverage... might be able to rectify some of that, but not sure if I'll be online at all for the next day or so).