How to advertise a different router/gateway ip via DHCP in OpenWRT?
In general, you need to configure the DHCP option with code 3 (router). (A list of all options can be found in http://www.networksorcery.com/enp/protocol/bootp/options.htm )
For example, to advise the gateway IP 192.168.1.2, you will send this option:
Now, for OpenWRT, you have 2 methods to configure it:
In command line
uci add_list dhcp.lan.dhcp_option=”3,192.168.1.2″
uci commit dhcp
In Web LuCI
In “network” -> “Interfaces” -> “LAN”, add this to the “DHCP-Options” field in the “DHCP Server” section:
The click “Save & Apply”.