ネットワーキングについて学びたいです。特に、現在プライマリルータに接続されているNATの背後で実行されるプライベートネットワークを作成しようとしています。
私の考えは次のとおりです。
+---------------------------------------------------+
|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 |
| |
+---------------+
これでRaspberry Piを正しく設定したようです。構成は次のとおりです。
/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
しかし、ログに示すように、dnsmasqはIPアドレスを配布していないようです。
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
クライアントがIPを要求すると、最後のメッセージが繰り返されます。以下は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
私は何を見逃していますか?究極の目標は、10.0.0.0/24の範囲内のすべてのネットワークがNATを介して残りのインターネットに接続することです。