0

I am trying to learn about networking, specifically, what I am currently trying is creating a private network that runs behind a NAT that connects to my main router.

The way I've though of it is as follows:

                                 +---------------------------------------------------+
                                 |10.0.0.0/24                                        |
                                 |                               +-------+           |
                          +------+---------------------------+   |Switch |   +-----+ |
                          |Raspberry Pi                      |   |       +---+     | |
                          |                                  |   |       |   +-----+ |
                          |                              eth1+---+       |           |
    +-----------------+   |                          10.0.0.1|   |       |           |
    |Router           |   |                                  |   |       |   +-----+ |
    |192.168.100.1    +---+eth0              dnsmasq settings|   |       +---+     | |
+---+dhcp:            |   |192.168.100.5   range: 10.0.0.2/24|   |       |   +-----+ |
    |192.168.100.2/24 |   |              gateway:    10.0.0.1|   +-------+           |
    |                 |   |                                  |                       |
    +-----+------+----+   +------+---------------------------+                       |
          |      |               |                                                   |
          |      |               +---------------------------------------------------+
          |      |
          |      +------------------------------------+ Other devices
          |
          |       +---------------+
          |       |pi-hole        |
          +-------+192.168.100.3  |
                  |               |
                  +---------------+

Now I think I've set up the raspberry pi correctly. The configs are as follows:

/etc/dnsmasq.conf

domain=local.pi
local=/local.pi/

no-hosts
addn-hosts=/etc/hosts.d

localise-queries

no-poll
no-resolv
cache-size=10000

log-async
log-queries=extra
log-facility=/var/log/dnsmasq/dnsmasq.log

local-ttl=2

server=192.168.100.3
server=9.9.9.9

domain-needed
bogus-priv

interface=eth1
dhcp-authoritative
dhcp-range=10.0.0.2,10.0.0.254,1h
dhcp-option=option:router,10.0.0.1
dhcp-leasefile=/etc/dhcp.leases

However, the dnsmasq doesn't seem to hand out any ip addresses, as evident by the logs:

Sep 30 22:37:25 dnsmasq[3296]: started, version 2.76 cachesize 10000
Sep 30 22:37:25 dnsmasq[3296]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
Sep 30 22:37:25 dnsmasq-dhcp[3296]: DHCP, IP range 10.0.0.2 -- 10.0.0.254, lease time 1h
Sep 30 22:37:25 dnsmasq[3296]: using nameserver 9.9.9.9#53
Sep 30 22:37:25 dnsmasq[3296]: using nameserver 192.168.100.3#53
Sep 30 22:37:25 dnsmasq[3296]: using local addresses only for domain local.pi
Sep 30 22:37:33 dnsmasq-dhcp[3296]: no address range available for DHCP request via eth1

That last message continually repeats as clients request an IP. The following is the output of tcpdump:

# tcpdump -v
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 262144 bytes
23:14:53.372604 IP (tos 0x0, ttl 64, id 17534, offset 0, flags [none], proto UDP (17), length 384)
   0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from b8:27:eb:64:2b:f2 (oui Unknown), length 356, xid 0x37bc3a64, secs 11906, Flags [none]
   Client-Ethernet-Address b8:27:eb:64:2b:f2 (oui Unknown)
   Vendor-rfc1048 Extensions
     Magic Cookie 0x63825363
     DHCP-Message Option 53, length 1: Discover
     Client-ID Option 61, length 7: ether b8:27:eb:64:2b:f2
     SLP-NA Option 80, length 0""
     NOAUTO Option 116, length 1: Y
     MSZ Option 57, length 2: 1472
     Vendor-Class Option 60, length 56: "dhcpcd-6.11.5:Linux-4.14.34-hypriotos-v7+:armv7l:BCM2835"
     Hostname Option 12, length 14: "test-client"
     T145 Option 145, length 1: 1
     Parameter-Request Option 55, length 15:
       Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway
       Domain-Name-Server, Hostname, Domain-Name, MTU
       BR, NTP, Lease-Time, Server-ID
       RN, RB, Option 119
23:15:07.057241 IP (tos 0x0, ttl 64, id 26091, offset 0, flags [none], proto UDP (17), length 384)
   0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:e0:4c:23:c2:22 (oui Unknown), length 356, xid 0x1b0502bb, secs 8250, Flags [none]
   Client-Ethernet-Address 00:e0:4c:23:c2:22 (oui Unknown)
   Vendor-rfc1048 Extensions
     Magic Cookie 0x63825363
     DHCP-Message Option 53, length 1: Discover
     Client-ID Option 61, length 7: ether 00:e0:4c:23:c2:22
     SLP-NA Option 80, length 0""
     NOAUTO Option 116, length 1: Y
     MSZ Option 57, length 2: 1472
     Vendor-Class Option 60, length 56: "dhcpcd-6.11.5:Linux-4.14.34-hypriotos-v7+:armv7l:BCM2835"
     Hostname Option 12, length 14: "gateway"
     T145 Option 145, length 1: 1
     Parameter-Request Option 55, length 15:
       Subnet-Mask, Classless-Static-Route, Static-Route, Default-Gateway
       Domain-Name-Server, Hostname, Domain-Name, MTU
       BR, NTP, Lease-Time, Server-ID
       RN, RB, Option 119#
^C
2 packets captured
2 packets received by filter
0 packets dropped by kernel

What am I missing? The end goal is that all those in the 10.0.0.0/24 range will connect to the rest of the internet behind a nat.

  • have you enabled ip forwarding? – Antonio J. Aguilar Bravo Sep 30 '18 at 23:50
  • 1
    "Sep 30 22:37:33 dnsmasq-dhcp[3296]: no address range available for DHCP request via eth1". You should give more informations about your config to complete the schema. eg ip -4 -br address, so this message gets more sense. – A.B Oct 1 '18 at 5:42
  • Relevant info. – Isaac Oct 1 '18 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.