2 public IPs, best setup

Thanks for your help.
Unfortunately, dhcp is still not working and I have no idea why.

Here is my /etc/config/dhcp file:

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'
        option ra_management '1'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

config dhcp 'SMA'
        option start '100'
        option leasetime '12h'
        option limit '150'
        option interface 'SMA'

config dhcp 'guest'
        option start '100'
        option leasetime '12h'
        option limit '150'
        option interface 'guest'

Is there a log file for dhcp on openwrt server to see what is happening?
Any help would be appreciated. Thank you.

It appears you have copied the whole old /etc/config/dhcp file from 15.05. That will not work.

The configuration of dnsmasq has changed a lot. Discard the old file and edit the new one to add your extra interfaces. I think the new default file is at /rom/etc/config/dhcp. Copy that over the old one. If there isn't a default file in rom, remove the existing file and reboot so the firstboot script regenerates it.

1 Like

Thank you.

Can I do it over the GUI? The problem is that I have no idea how to configure the /rom/etc/config/dhcp.
Basically I have 2 interfaces where I need to use DHCP:

config interface 'lan'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.0.2'
        option device 'br-lan'

and

config interface 'guest'
        option _orig_ifname 'wlan0-1'
        option _orig_bridge 'false'
        option proto 'static'
        option ipaddr '192.168.10.1'
        option netmask '255.255.255.0'

The first should allocate IPs between 192.168.0.100 - 150 and the 2nd should allocate IPs between 192.168.10.100 - 150.

Is there an easy way to do this over the GUI?

Yes, but first I would start with a fresh image without restore of config.
Just go to the interface in the GUI and click on edit then you can configure the DHCP server individually for each Interface.

3 Likes

Thanks.
With a fresh install I would lose all my port forwardings and virtual servers.

What exactly I should change here?

Thanks again for all your help.

@faser makes a good point that trying to reuse any config file from 15.05 into 21.02 is likely to have problems. Use your old files as a reference but rebuild the configuration starting from the new defaults.

3 Likes

Looks like I managed to screw up my router... :slight_smile: After a few sysupgrade commands it won't start any more, I can not even do a factory reset as it looks like I can not even connect via an ethernet cable to the router.
Thank God, I have another one I can use for now.

If you have any suggestion of what to do to start the old router, I would appreciate it. Thank you.

(ethernet access required).