FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

12658 questions

15038 answers

24075 comments

46992 members

0 votes
99 views 0 comments
by

I found an issue, that in some VLANs i have created in the current version - the integrated DHCP Server does not work anymore.

As example i have four vlans leaving on eth0:

- 1 LAN 

- 2 TEST

- 10 Baugast

- 20 Mobile

Each VLAN has its own zone and is allowed to communicate to WAN, but not to the others.

So for LAN & Test everything works as expected, but for Guest & Mobile the DHCP will not work. This scenario could be build a lot of times and will work for the LAN & TEST all the time. 

But in Guest & Mobile you can communicate, if you assign a static IP, but you will never get a DHCP answer (Offer).

Since there were no useful answers to similar topics, i will provide the solution as answer for the community

1 Answer

0 votes
by

The Solution:

to understand, why this could happend, you have to know, that in teltonika's implementation not a special dhcp deamon is responsible for serving addresses, this is done by another process - which handles also DNS requests.

Let's open the cli and check some config files:

1. in /etc/config/dhcp you will find the options:

config dnsmasq                                       

        option domainneeded '1'                              

        option boguspriv '1'                                 

        option filterwin2k '0'                   

        option localise_queries '1'              

        option rebind_protection '1'        

        option rebind_localhost '1'                  

        option local '/lan/'                                 

        option domain 'lan'                                  

        option expandhosts '1'                    

        option nonegcache '0'                        

        option authoritative '1'                     

        option readethers '1'                                

        option leasefile '/tmp/dhcp.leases'

        option nonwildcard '1'                   

        option dhcpscript '/usr/sbin/dhcpinfo.sh'

        option notinterface 'wan'                    

        option logqueries '0'                        

        option localservice '0'                              

        option interface 'LAN TEST'                    

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'

        option loglevel '4'         

config dhcp 'BauGast'                                        

        option interface 'BauGast'               

        option leasetime '4h'                    

        option relay_enabled '0'            

        option force '0'                             

        option start '100'                                   

        option limit '150'                                   

config dhcp 'TEST'                                 

        option interface 'TEST'                            

        option start '1'                   

        option limit '50'                                    

        option leasetime '96h'                   

        option force '0'                             

config dhcp 'Mobile'                                      

        option interface 'Mobile'                         

        option start '1'                          

        option limit '50'                            

        option leasetime '4h'               

        option force '0'                             

        option netmask '255.255.255.0'

        list dhcp_option_force '6,9.9.9.9,1.1.1.2'

                                                  

config dhcp 'LAN'                              

        option interface 'LAN'                 

        option start '1'            

        option limit '50'           

        option leasetime '96h'                    

                                     

2. and there you will notice in one line the non DHCP working interfaces are missing.

        option interface 'LAN TEST'

3. how this comes ...

while exploring "ps" you will only find the DHCP client udhcp - which will retrieve IP adresses on the WAN interface

10103 root      1468 S    udhcpc -p /var/run/udhcpc-wwan0.pid -s /lib/netifd/dhcp_mobile.script -f -t 0 -i wwan0 -x hostname:Telto

There is no other DHCP deamon running...

But what i found was a DNSMASQ - and as i remeber this tool can act as a DHCP server too - not only DNS

26256 dnsmasq   1212 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid

26263 root      1208 S    /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid

4. exploring the config file for the process shows, that the service is bound only on two interfaces - and that's it

# auto-generated config file from /etc/config/dhcp

conf-file=/etc/dnsmasq.conf

dhcp-authoritative

bind-dynamic                               

domain=lan       

local=/lan/                                    

interface=eth0.30    

interface=eth0                 

except-interface=wan                           

... cfg is stripped ... due limits here ...

5. Solution

We have learned a DNS tool is handling the DHCP Server things - so it might be a good idea to take a look on the DNS Settings ;)

You have to add all interfaces under "listen Interfaces" and ... it works ...

What we have learned is DNS & DHCP Service come together ;)                          

Best answer