Hi all,
I'm recently using OpenWrt (installed on Rpi Zero W) as a DHCP relay. I think there exists problem in my setting. Although that the clients can obtain IP addresses from the DHCP server, but it takes circa 1 minute to do this.
My routing is:
Rpi (OpenWrt @ 192.168.2.1) --- switch --- ISP modem (DHCP server @ 192.168.1.1)
My OpenWrt configs:
etc/config/network
:
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd7a:4e97:e56c::/48'
option packet_steering '1'
config interface 'lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option device 'wlan0'
option defaultroute '0'
option ipaddr '192.168.2.1'
config device
option name 'eth0'
option acceptlocal '1'
config device
option name 'wlan0'
option acceptlocal '1'
config interface 'br'
option proto 'relay'
list network 'lan'
list network 'wan'
option forward_bcast '0'
option force_link '1'
config interface 'wan'
option proto 'none'
option device 'eth0'
option force_link '1'
option defaultroute '0'
/etc/config/wireless
:
config wifi-device 'radio0'
option type 'mac80211'
option path 'platform/soc/20300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
option band '2g'
option htmode 'HT20'
option country 'TW'
option disabled '0'
option cell_density '0'
option channel 'auto'
option distance '4'
config wifi-iface 'default_radio0'
option device 'radio0'
option mode 'ap'
option ssid 'OpenWrt'
option disabled '0'
option network 'lan'
option encryption 'psk2'
option key 'xxxxxxxxxxx
/etc/config/dhcp
: (IIUC, ignore
means no DHCP server on the speficied interface)
config dnsmasq
option localise_queries '1'
option rebind_protection '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option localservice '1'
option ednspacket_max '1232'
option boguspriv '0'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option ignore '1'
option dynamicdhcp '0'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config dhcp 'br'
option interface 'br'
option ignore '1'
Is there anything wrong in my network config? Furthermore, I'm not sure that protocol relay
is required for my use case, how about simply using unmanaged
(I tried and it's not working. Maybe it's because of my incorrect configuration) ?
Please let me know if other configs are required!
Thanks,
Huichun