How to configure for automatic ip?

Hi All,

We want to create a network between some Linux devices. A master device has LTE modem and connected to the internet. Other devices should communicate with each other over the master device.

ppp

We prepared a script and A master device connect to with PPP method and with the following commands in script able to share internet to the network.

/sbin/ifconfig eth0 10.10.10.79 broadcast 10.10.10.255 netmask 255.255.255.0 mtu 1500
/sbin/ifconfig eth0 10.10.10.79 up
/sbin/route add default gw 10.10.10.1 netmask 0.0.0.0 metric 1
/etc/init.d/bind restart

route del default
route add default gw 10.64.64.64

iptables -F
iptables -t nat -F
iptables -X

#Always accept loopback traffic
iptables -A INPUT -i lo -j ACCEPT

#Allow outgoing connections from the LAN side.
iptables -A FORWARD -i eth0 -o ppp0 -j ACCEPT
 
#Masquerade.
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

echo 1 > /proc/sys/net/ipv4/ip_forward

If we set static Ip to other Linux devices and run following command, they can connect to the master device and internet.

route add default gw 10.10.10.79 dev eth0

So far, so good!

But, at my system, I want to use dhcp and give Ip automatically. I configured /etc/dhcp/dhcpd.conf like following at master device, for example I couldn’t ping 10.10.10.79 from NVR.

subnet 10.10.10.0 netmask 255.255.255.0 {
   range 10.10.10.20 10.10.10.78;
   option routers 10.10.10.79;
   option broadcast-address 10.10.10.255;
   option ip-forwarding on;
}

Could you advise me?

Do you have a working dhcp client and configuration in the device within local network?

Could you connect your Linux notebook to that system and try to get ip address from dhcp server? And please take a wireshark/tcpdump capture and attach to this thread.

I attached wireshark logs.

No.     Time           Source                Destination           Protocol Length Info
      1 0.000000000    0.0.0.0               255.255.255.255       DHCP     342    DHCP Discover - Transaction ID 0x144f2e73

Frame 1: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
      2 6.073964020    fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     233    Standard query 0x0000 PTR _ipps._tcp.local, "QM" question PTR _ftp._tcp.local, "QM" question PTR _webdav._tcp.local, "QM" question PTR _webdavs._tcp.local, "QM" question PTR _sftp-ssh._tcp.local, "QM" question PTR _smb._tcp.local, "QM" question PTR _afpovertcp._tcp.local, "QM" question PTR _nfs._tcp.local, "QM" question PTR _ipp._tcp.local, "QM" question PTR imx6solosabresd._sftp-ssh._tcp.local

Frame 2: 233 bytes on wire (1864 bits), 233 bytes captured (1864 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
      3 11.544620781   0.0.0.0               255.255.255.255       DHCP     342    DHCP Discover - Transaction ID 0x144f2e73

Frame 3: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
      4 11.994951808   0.0.0.0               255.255.255.255       DHCP     590    DHCP Discover - Transaction ID 0x81c74d6b

Frame 4: 590 bytes on wire (4720 bits), 590 bytes captured (4720 bits) on interface 0
Ethernet II, Src: fe:93:00:2e:76:50 (fe:93:00:2e:76:50), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
      5 16.994441730   0.0.0.0               255.255.255.255       DHCP     590    DHCP Discover - Transaction ID 0x81c74d6b

Frame 5: 590 bytes on wire (4720 bits), 590 bytes captured (4720 bits) on interface 0
Ethernet II, Src: fe:93:00:2e:76:50 (fe:93:00:2e:76:50), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
      6 18.712829255   ::                    ff02::16              ICMPv6   130    Multicast Listener Report Message v2

Frame 6: 130 bytes on wire (1040 bits), 130 bytes captured (1040 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_16 (33:33:00:00:00:16)
Internet Protocol Version 6, Src: ::, Dst: ff02::16
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
      7 18.732826340   ::                    ff02::16              ICMPv6   130    Multicast Listener Report Message v2

Frame 7: 130 bytes on wire (1040 bits), 130 bytes captured (1040 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_16 (33:33:00:00:00:16)
Internet Protocol Version 6, Src: ::, Dst: ff02::16
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
      8 18.741130676   0.0.0.0               255.255.255.255       DHCP     342    DHCP Request  - Transaction ID 0xec517d4e

Frame 8: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Request)

No.     Time           Source                Destination           Protocol Length Info
      9 18.940886581   ::                    ff02::1:ffe9:b9bd     ICMPv6   86     Neighbor Solicitation for fe80::f6e1:dbca:e0e9:b9bd

Frame 9: 86 bytes on wire (688 bits), 86 bytes captured (688 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_ff:e9:b9:bd (33:33:ff:e9:b9:bd)
Internet Protocol Version 6, Src: ::, Dst: ff02::1:ffe9:b9bd
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     10 19.240942040   ::                    ff02::16              ICMPv6   90     Multicast Listener Report Message v2

Frame 10: 90 bytes on wire (720 bits), 90 bytes captured (720 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_16 (33:33:00:00:00:16)
Internet Protocol Version 6, Src: ::, Dst: ff02::16
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     11 19.945198873   fe80::f6e1:dbca:e0e9:b9bd ff02::16              ICMPv6   90     Multicast Listener Report Message v2

Frame 11: 90 bytes on wire (720 bits), 90 bytes captured (720 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_16 (33:33:00:00:00:16)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::16
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     12 19.956819529   fe80::f6e1:dbca:e0e9:b9bd ff02::16              ICMPv6   90     Multicast Listener Report Message v2

Frame 12: 90 bytes on wire (720 bits), 90 bytes captured (720 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_16 (33:33:00:00:00:16)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::16
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     13 20.046042792   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     203    Standard query 0x0000 PTR _ipps._tcp.local, "QM" question PTR _ftp._tcp.local, "QM" question PTR _webdav._tcp.local, "QM" question PTR _webdavs._tcp.local, "QM" question PTR _sftp-ssh._tcp.local, "QM" question PTR _smb._tcp.local, "QM" question PTR _afpovertcp._tcp.local, "QM" question PTR _nfs._tcp.local, "QM" question PTR _ipp._tcp.local, "QM" question

Frame 13: 203 bytes on wire (1624 bits), 203 bytes captured (1624 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
     14 20.113745321   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     210    Standard query 0x0000 ANY d.b.9.b.9.e.0.e.a.c.b.d.1.e.6.f.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa, "QM" question ANY asis.local, "QM" question AAAA fe80::f6e1:dbca:e0e9:b9bd PTR asis.local

Frame 14: 210 bytes on wire (1680 bits), 210 bytes captured (1680 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
     15 20.162878597   fe80::fc93:ff:fe2e:7650 ff02::fb              MDNS     201    Standard query response 0x0000 PTR imx6solosabresd._sftp-ssh._tcp.local TXT, cache flush SRV, cache flush 0 0 22 imx6solosabresd.local AAAA, cache flush fe80::fc93:ff:fe2e:7650

Frame 15: 201 bytes on wire (1608 bits), 201 bytes captured (1608 bits) on interface 0
Ethernet II, Src: fe:93:00:2e:76:50 (fe:93:00:2e:76:50), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::fc93:ff:fe2e:7650, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (response)

No.     Time           Source                Destination           Protocol Length Info
     16 20.364788364   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     210    Standard query 0x0000 ANY d.b.9.b.9.e.0.e.a.c.b.d.1.e.6.f.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa, "QM" question ANY asis.local, "QM" question AAAA fe80::f6e1:dbca:e0e9:b9bd PTR asis.local

Frame 16: 210 bytes on wire (1680 bits), 210 bytes captured (1680 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
     17 20.615049890   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     210    Standard query 0x0000 ANY d.b.9.b.9.e.0.e.a.c.b.d.1.e.6.f.0.0.0.0.0.0.0.0.0.0.0.0.0.8.e.f.ip6.arpa, "QM" question ANY asis.local, "QM" question AAAA fe80::f6e1:dbca:e0e9:b9bd PTR asis.local

Frame 17: 210 bytes on wire (1680 bits), 210 bytes captured (1680 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
     18 20.661866667   fe80::f6e1:dbca:e0e9:b9bd ff02::2               ICMPv6   62     Router Solicitation

Frame 18: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_02 (33:33:00:00:00:02)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::2
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     19 20.680853877   fe80::f6e1:dbca:e0e9:b9bd ff02::16              ICMPv6   90     Multicast Listener Report Message v2

Frame 19: 90 bytes on wire (720 bits), 90 bytes captured (720 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_16 (33:33:00:00:00:16)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::16
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     20 20.776948128   fe80::f6e1:dbca:e0e9:b9bd ff02::16              ICMPv6   110    Multicast Listener Report Message v2

Frame 20: 110 bytes on wire (880 bits), 110 bytes captured (880 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_16 (33:33:00:00:00:16)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::16
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     21 20.815288639   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     198    Standard query response 0x0000 PTR, cache flush asis.local AAAA, cache flush fe80::f6e1:dbca:e0e9:b9bd

Frame 21: 198 bytes on wire (1584 bits), 198 bytes captured (1584 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (response)

No.     Time           Source                Destination           Protocol Length Info
     22 21.046271467   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     233    Standard query 0x0000 PTR _ipps._tcp.local, "QM" question PTR _ftp._tcp.local, "QM" question PTR _webdav._tcp.local, "QM" question PTR _webdavs._tcp.local, "QM" question PTR _sftp-ssh._tcp.local, "QM" question PTR _smb._tcp.local, "QM" question PTR _afpovertcp._tcp.local, "QM" question PTR _nfs._tcp.local, "QM" question PTR _ipp._tcp.local, "QM" question PTR imx6solosabresd._sftp-ssh._tcp.local

Frame 22: 233 bytes on wire (1864 bits), 233 bytes captured (1864 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
     23 21.453008393   0.0.0.0               255.255.255.255       DHCP     342    DHCP Request  - Transaction ID 0xec517d4e

Frame 23: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Request)

No.     Time           Source                Destination           Protocol Length Info
     24 21.933475724   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     198    Standard query response 0x0000 PTR, cache flush asis.local AAAA, cache flush fe80::f6e1:dbca:e0e9:b9bd

Frame 24: 198 bytes on wire (1584 bits), 198 bytes captured (1584 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (response)

No.     Time           Source                Destination           Protocol Length Info
     25 21.991624511   0.0.0.0               255.255.255.255       DHCP     590    DHCP Discover - Transaction ID 0x81c74d6b

Frame 25: 590 bytes on wire (4720 bits), 590 bytes captured (4720 bits) on interface 0
Ethernet II, Src: fe:93:00:2e:76:50 (fe:93:00:2e:76:50), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
     26 23.047529017   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     233    Standard query 0x0000 PTR _ipps._tcp.local, "QM" question PTR _ftp._tcp.local, "QM" question PTR _webdav._tcp.local, "QM" question PTR _webdavs._tcp.local, "QM" question PTR _sftp-ssh._tcp.local, "QM" question PTR _smb._tcp.local, "QM" question PTR _afpovertcp._tcp.local, "QM" question PTR _nfs._tcp.local, "QM" question PTR _ipp._tcp.local, "QM" question PTR imx6solosabresd._sftp-ssh._tcp.local

Frame 26: 233 bytes on wire (1864 bits), 233 bytes captured (1864 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
     27 24.051529875   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     198    Standard query response 0x0000 PTR, cache flush asis.local AAAA, cache flush fe80::f6e1:dbca:e0e9:b9bd

Frame 27: 198 bytes on wire (1584 bits), 198 bytes captured (1584 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (response)

No.     Time           Source                Destination           Protocol Length Info
     28 24.662079916   fe80::f6e1:dbca:e0e9:b9bd ff02::2               ICMPv6   62     Router Solicitation

Frame 28: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_02 (33:33:00:00:00:02)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::2
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     29 26.036528656   0.0.0.0               255.255.255.255       DHCP     342    DHCP Request  - Transaction ID 0xec517d4e

Frame 29: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Request)

No.     Time           Source                Destination           Protocol Length Info
     30 26.994489124   0.0.0.0               255.255.255.255       DHCP     590    DHCP Discover - Transaction ID 0x81c74d6b

Frame 30: 590 bytes on wire (4720 bits), 590 bytes captured (4720 bits) on interface 0
Ethernet II, Src: fe:93:00:2e:76:50 (fe:93:00:2e:76:50), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
     31 27.049859535   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     233    Standard query 0x0000 PTR _ipps._tcp.local, "QM" question PTR _ftp._tcp.local, "QM" question PTR _webdav._tcp.local, "QM" question PTR _webdavs._tcp.local, "QM" question PTR _sftp-ssh._tcp.local, "QM" question PTR _smb._tcp.local, "QM" question PTR _afpovertcp._tcp.local, "QM" question PTR _nfs._tcp.local, "QM" question PTR _ipp._tcp.local, "QM" question PTR imx6solosabresd._sftp-ssh._tcp.local

Frame 31: 233 bytes on wire (1864 bits), 233 bytes captured (1864 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
     32 28.665557757   fe80::f6e1:dbca:e0e9:b9bd ff02::2               ICMPv6   62     Router Solicitation

Frame 32: 62 bytes on wire (496 bits), 62 bytes captured (496 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_02 (33:33:00:00:00:02)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::2
Internet Control Message Protocol v6

No.     Time           Source                Destination           Protocol Length Info
     33 30.670523415   0.0.0.0               255.255.255.255       DHCP     342    DHCP Discover - Transaction ID 0x7013844e

Frame 33: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
     34 31.994506964   0.0.0.0               255.255.255.255       DHCP     590    DHCP Discover - Transaction ID 0x81c74d6b

Frame 34: 590 bytes on wire (4720 bits), 590 bytes captured (4720 bits) on interface 0
Ethernet II, Src: fe:93:00:2e:76:50 (fe:93:00:2e:76:50), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
     35 33.799905920   0.0.0.0               255.255.255.255       DHCP     342    DHCP Discover - Transaction ID 0x7013844e

Frame 35: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
     36 35.057418300   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     233    Standard query 0x0000 PTR _ipps._tcp.local, "QM" question PTR _ftp._tcp.local, "QM" question PTR _webdav._tcp.local, "QM" question PTR _webdavs._tcp.local, "QM" question PTR _sftp-ssh._tcp.local, "QM" question PTR _smb._tcp.local, "QM" question PTR _afpovertcp._tcp.local, "QM" question PTR _nfs._tcp.local, "QM" question PTR _ipp._tcp.local, "QM" question PTR imx6solosabresd._sftp-ssh._tcp.local

Frame 36: 233 bytes on wire (1864 bits), 233 bytes captured (1864 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

No.     Time           Source                Destination           Protocol Length Info
     37 36.992058320   0.0.0.0               255.255.255.255       DHCP     590    DHCP Discover - Transaction ID 0x81c74d6b

Frame 37: 590 bytes on wire (4720 bits), 590 bytes captured (4720 bits) on interface 0
Ethernet II, Src: fe:93:00:2e:76:50 (fe:93:00:2e:76:50), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
     38 40.285036053   0.0.0.0               255.255.255.255       DHCP     342    DHCP Discover - Transaction ID 0x7013844e

Frame 38: 342 bytes on wire (2736 bits), 342 bytes captured (2736 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 0.0.0.0, Dst: 255.255.255.255
User Datagram Protocol, Src Port: 68, Dst Port: 67
Bootstrap Protocol (Discover)

No.     Time           Source                Destination           Protocol Length Info
     39 51.073610232   fe80::f6e1:dbca:e0e9:b9bd ff02::fb              MDNS     233    Standard query 0x0000 PTR _ipps._tcp.local, "QM" question PTR _ftp._tcp.local, "QM" question PTR _webdav._tcp.local, "QM" question PTR _webdavs._tcp.local, "QM" question PTR _sftp-ssh._tcp.local, "QM" question PTR _smb._tcp.local, "QM" question PTR _afpovertcp._tcp.local, "QM" question PTR _nfs._tcp.local, "QM" question PTR _ipp._tcp.local, "QM" question PTR imx6solosabresd._sftp-ssh._tcp.local

Frame 39: 233 bytes on wire (1864 bits), 233 bytes captured (1864 bits) on interface 0
Ethernet II, Src: QuantaCo_6b:8e:e9 (54:ab:3a:6b:8e:e9), Dst: IPv6mcast_fb (33:33:00:00:00:fb)
Internet Protocol Version 6, Src: fe80::f6e1:dbca:e0e9:b9bd, Dst: ff02::fb
User Datagram Protocol, Src Port: 5353, Dst Port: 5353
Multicast Domain Name System (query)

Please attach pcap file if possible.

Last log I sent before, Another device at network, which has static Ip. Now I disconnected it, only dhcp server and my linux computer located in my network.

Wireshark Log ( pcap )

According to pcap output, there is no dhcp server in your network.

If cabling is okay, your dhcp server process is not working or running properly. You must see dhcp offer and answer packets.

We installed isc-dhcp server at raspberry pi with the same settings. It works properly. Also in my embedded device dhcpd service starts successfully.

You can try to attach dhcp server process with strace to see if there is anything received or sent.

It is also good to run tcpdump and save capture in your embedded box.

I removed dnsmasq and the new logs here.

wireshark log without dnsmasq

[email protected]:~# ps aux|grep dhcpd
dhcp       977  0.0  0.2  34080  2896 ?        Ss   11:10   0:00 /usr/sbin/dhcpd -q eth0 -user dhcp -group dhcp
root       979  0.0  0.0   1880   516 ttymxc2  S+   11:11   0:00 grep dhcpd

[email protected]:~# strace -p 977
strace: Process 977 attached
futex(0x768bf098, FUTEX_WAIT_PRIVATE, 0, NULL

/etc/dhcp/dhcpd.conf

option domain-name "home";
option domain-name-servers 172.16.20.62;

default-lease-time 600;
max-lease-time 7200;

authoritative;

ddns-update-style none;

subnet 172.16.20.0 netmask 255.255.255.192 {

        range 172.16.20.11 172.16.20.19;
        range 172.16.20.31 172.16.20.49;

        option domain-name-servers 172.16.20.62;
        option domain-name "home";
        option broadcast-address 172.16.20.63; }

/etc/network/interfaces

auto lo
iface lo inet loopback
address 172.16.20.21
gateway 172.16.20.62
broadcast 172.16.20.63
netmask 255.255.255.192

According the wireshark output, you’re not getting any dhcp answer from any server in the LAN.

And if your strace outputs comes from while requesting a new ip through your notebook or some other clients, we can say that your embedded system which is running dhcpd couldn’t get any broadcast dhcp request packet from network.

I don’t have a chance to reproduce your environment but you should see dhcp request packets in your dhcp server system first.

tcpdump logs

14:25:00.376034 ARP, Request who-has 169.254.26.250 tell 0.0.0.0, length 28
14:25:00.478874 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? 250.26.254.169.in-addr.arpa. (45)
14:25:00.481106 IP imx6solosabresd.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 250.26.254.169.in-addr.arpa. (45)
14:25:01.479155 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? 250.26.254.169.in-addr.arpa. (45)
14:25:01.481391 IP imx6solosabresd.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 250.26.254.169.in-addr.arpa. (45)
14:25:02.409581 ARP, Request who-has 169.254.26.250 tell 169.254.26.250, length 28
14:25:03.481489 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? 250.26.254.169.in-addr.arpa. (45)
14:25:10.497411 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? b.f.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
14:25:15.506369 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? 251.0.0.224.in-addr.arpa. (42)
14:25:48.802573 IP6 :: > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28
14:25:48.830822 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9 (oui Unknown), length 300
14:25:48.909800 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? 6.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
14:25:48.912180 IP imx6solosabresd.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? 6.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
14:25:48.962556 IP6 :: > ff02::1:ffe9:b9bd: ICMP6, neighbor solicitation, who has asis.local, length 32
14:25:49.786488 IP6 :: > ff02::16: HBH ICMP6, multicast listener report v2, 1 group record(s), length 28
14:25:49.912113 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? 6.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
14:25:53.913907 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? 255.255.255.255.in-addr.arpa. (46)
14:25:58.919857 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? d.b.9.b.9.e.f.f.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
14:25:58.922244 IP imx6solosabresd.local.mdns > 224.0.0.251.mdns: 0 PTR (QM)? d.b.9.b.9.e.f.f.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
14:25:59.921610 IP6 imx6solosabresd.local.mdns > ff02::fb.mdns: 0 PTR (QM)? d.b.9.b.9.e.f.f.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.f.f.ip6.arpa. (90)
14:26:05.085547 IP6 asis.local.mdns > ff02::fb.mdns: 0 [1a] [9q] PTR (QM)? _ipps._tcp.local. PTR (QM)? _ftp._tcp.local. PTR (QM)? _webdav._tcp.local. PTR (QM)? _webdavs._tcp.local. PTR (QM)? _sftp-ssh._tc
p.local. PTR (QM)? _smb._tcp.local. PTR (QM)? _afpovertcp._tcp.local. PTR (QM)? _nfs._tcp.local. PTR (QM)? _ipp._tcp.local. (171)
14:26:06.422270 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9 (oui Unknown), length 300
14:26:07.231249 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from fe:93:00:2e:76:50 (oui Unknown), length 548
14:26:08.642485 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9 (oui Unknown), length 300
tcpdump -i eth0 port 67  -e -n

14:29:59.279669 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:01.675472 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:07.675075 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:21.347571 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:23.736487 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:27.229787 fe:93:00:2e:76:50 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fe:93:00:2e:76:50, length 548
14:30:31.452233 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:32.233127 fe:93:00:2e:76:50 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fe:93:00:2e:76:50, length 548


tcpdump -i eth0 port 68  -e -n

14:30:42.228855 fe:93:00:2e:76:50 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fe:93:00:2e:76:50, length 548
14:30:44.052428 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:44.467228 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:47.232938 fe:93:00:2e:76:50 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fe:93:00:2e:76:50, length 548
14:30:47.397384 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:52.136903 54:ab:3a:6b:8e:e9 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 54:ab:3a:6b:8e:e9, length 300
14:30:52.232055 fe:93:00:2e:76:50 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 590: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from fe:93:00:2e:76:50, length 548

@demirten I found problem. My problem like is a bug like at the following link.

http://isc-dhcp-users.2343191.n4.nabble.com/dhcpd-4-3-6-works-only-when-launched-with-f-or-d-flag-td2907.html

I will try after changing bind library.

You can try dnsmasq on embedded systems. It provides simpler and lightweight solution. If you don’t need any special feature from dhcpd, dnsmasq will be a good alternative for you.

Or you may want to run dhcpd on foreground, increase verbosity level if provided, start dhcpd on foreground with strace to check that if there is an unexpected syscall return value.

1 Like

Thanks you, I started dhcpd with -d parameter, and it assings ip to client successfully. I removed dnsmasq, I will install it again and try.

Now, I use dnsmasq and everything is ok. Thank you @demirten.