Настройка Raspberry Pi в качестве DHCP / локального DNS-сервера, Stretch vs Wheezy
Я использовал dnsmasq в качестве DHCP-сервера / распознавателя на старой Raspberry Pi, работающей под управлением wheezy, в течение многих лет без каких-либо проблем. Я решил модернизировать, чтобы растянуть и, в то же время, до Raspberry Pi 3B +.
К сожалению, я пытаюсь настроить новый Pi для предоставления тех же служб DHCP и DNS, что и для старого Pi. Я использую dnsmasq для обеих служб. Я могу настроить новый Pi для правильной работы, когда он также не предоставляет службы DHCP / DNS, а вместо этого получает те из старого Pi. Но когда я пытаюсь получить эти услуги, я теряю связь с Интернетом. Такое ощущение, что я испортил настройку шлюза, хотя я не знаю как, и диагностика, которую я знаю, как запустить, похоже, не показывает проблемы со шлюзом.
На старом Pi, запущенном wheezy, я настроил интерфейс Ethernet в / etc / network / interfaces следующим образом:
iface eth0 inet static address 10.0.0.4 netmask 255.255.255.0 gateway 10.0.0.2
На новом Pi, работающем в режиме stretch, я настраиваю интерфейс Ethernet в dhcpcd.conf (обратите внимание, что здесь я использую другой статический IP-адрес, поэтому два устройства не сталкиваются, пока я пытаюсь осуществить переход к новое устройство):
interface eth0 static ip_address=10.0.0.5/24 static routers=10.0.0.2
Если я запускаю новый автономный Pi, я комментирую эти три строки, с тех пор новый Pi получает свой IP-адрес от старого Pi.
При растяжении процесс загрузки, похоже, включает в себя resolvconf и dhcpcd, переписывающий /etc/resolv.conf. Кроме того, resolvconf создает отдельный файл resolv.conf в /run/dnsmasq/resolv.conf..., и они не совпадают. Я также не понимаю, почему существуют два отдельных файла и какую роль играет каждый из них.
Вот /etc/resolv.conf после загрузки:
# Generated by resolvconf nameserver 127.0.0.1 # external nameservers nameserver 8.8.8.8 nameserver 8.8.4.4
Вот /run/dnsmasq/resolv.conf:
# Generated by resolvconf
Вот resolvconf.conf:
# Configuration for resolvconf(8) # See resolvconf.conf(5) for details resolv_conf=/etc/resolv.conf # If you run a local name server, you should uncomment the below line and # configure your subscribers configuration files below. name_servers=127.0.0.1, 8.8.8.8, 8.8.4.4 # Mirror the Debian package defaults for the below resolvers # so that resolvconf integrates seemlessly. dnsmasq_resolv=/var/run/dnsmasq/resolv.conf pdnsd_conf=/etc/pdnsd.conf unbound_conf=/var/cache/unbound/resolvconf_resolvers.conf
resolv.conf.tail:
# external nameservers nameserver 8.8.8.8 nameserver 8.8.4.4
и dhcpcd.conf:
# A sample configuration for dhcpcd. # See dhcpcd.conf(5) for details. # Allow users of this group to interact with dhcpcd via the control socket. #controlgroup wheel # Inform the DHCP server of our hostname for DDNS. hostname # Use the hardware address of the interface for the Client ID. clientid # or # Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361. # Some non-RFC compliant DHCP servers do not reply with this set. # In this case, comment out duid and enable clientid above. #duid # Persist interface configuration when dhcpcd exits. persistent # Rapid commit support. # Safe to enable by default because it requires the equivalent option set # on the server to actually work. option rapid_commit # A list of options to request from the DHCP server. option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes # Most distributions have NTP support. option ntp_servers # Respect the network MTU. This is applied to DHCP routes. option interface_mtu # A ServerID is required by RFC2131. require dhcp_server_identifier # Generate Stable Private IPv6 Addresses instead of hardware based ones slaac private # A list of options to request from the DHCP server. option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes # Most distributions have NTP support. option ntp_servers # Respect the network MTU. This is applied to DHCP routes. option interface_mtu # A ServerID is required by RFC2131. require dhcp_server_identifier # Generate Stable Private IPv6 Addresses instead of hardware based ones slaac private # This section needs to be live if mycroft is serving as # the DHCP server for the LAN. Conversely, if it isn't # serving in that role, it needs to be commented out. interface eth0 static ip_address=10.0.0.5/24 static routers=10.0.0.2 #static domain_name_servers=127.0.0.1,8.8.8.8,8.8.4.4 # not using ip6! #static ip6_address=fd51:42f8:caae:d92e::ff/64 # domain name servers specified in resolv.conf.tail #static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1 # It is possible to fall back to a static IP if DHCP fails: # define static profile #profile static_eth0 #static ip_address=192.168.1.23/24 #static routers=192.168.1.1 #static domain_name_servers=192.168.1.1 # fallback to static profile on eth0 #interface eth0 #fallback static_eth0
Предложения?
0 ответов на вопрос
Похожие вопросы
-
2
Как мне заставить мой микрофон работать под Debian GNOME?
-
2
Windows 7 Home Premium запоминает пароли общего доступа к сети?
-
5
Поделитесь XP сетевым подключением без перезагрузки?
-
-
5
Как мне сказать Windows использовать 802.11 вместо 3G?
-
4
Есть ли способ поделиться сканером многофункционального принтера?
-
6
Полноэкранная медленная вспышка в KDE 4
-
3
Есть ли способ соединить два компьютера через USB?
-
3
Как сохранить несколько подключений к интернету?
-
4
iPod-Touch для воспроизведения фильмов с ПК на PS3?
-
2
Mac не присоединится к рабочей группе Windows