OpenWrt Forum Archive

Topic: Linux/BSD not getting default gateway

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm using OpenWRT with dnsmasq for DHCP. For some reason, Windows clients and iOS clients all have no trouble and get the default gateway (which I set with DHCP option 3). Linux and BSD clients do not get the gateway and cannot access the network.

What could be the problem here? Is there an option for setting a default gateway besides using DHCP option 3?

config dhcp 'lan'
        option interface 'lan'
        option start '50'
        option limit '200'
        option leasetime '12h'
        option ra 'server'
        option dhcpv6 'server'
        option ra_management '1'
        list dhcp_option '3,192.168.10.1'
        list dhcp_option '121,192.168.11.0/24,192.168.10.2'

Disable 'ra' and 'dhcpv6' in an IPv4 only network.

In the standard setup where the router serving DHCP is also the default gateway, you do not need to set any dhcp options.

mk24 wrote:

Disable 'ra' and 'dhcpv6' in an IPv4 only network.

In the standard setup where the router serving DHCP is also the default gateway, you do not need to set any dhcp options.

Thanks. I'm trying that. In this case, the DHCP server is not the default gateway, however.

-- Update --

Removing the IPv6 entries did not solve the problem.

(Last edited by lightman on 2 Jun 2017, 23:09)

Hmm, I think it has something to do with option 121 but that shouldn't interfere. If I remove that, then a default gateway appears.

Yeah, this is bad. The only way I got it to work was to define the gateway in option 121, which is not supposed to happen.

"The default route of 0.0.0.0 is an illegal destination for a static route"

The discussion might have continued from here.