인터페이스가 작동 중인데도 DNSMASQ가 "알 수 없는 인터페이스 오류"로 시작을 거부합니다.

인터페이스가 작동 중인데도 DNSMASQ가 "알 수 없는 인터페이스 오류"로 시작을 거부합니다.

이것은 인터넷의 다른 곳에서는 찾을 수 없는 이상한 질문입니다. 이는 제가 엉망으로 만든 것일 수도 있다는 것을 암시합니다. 하지만 뭐죠?

dnsmasq.service모든 네트워크 서비스가 사용 가능하고 작동하는 동안 시작 시 또는 사용자 세션에서 부팅을 시도하면 unknown interface enp2s0오류와 함께 실패합니다... 시스템의 나머지 전체가 시작되었다고 주장하지 않는 한.

andrzej@andrzej-PC ~ $ sudo systemctl start dnsmasq
Job for dnsmasq.service failed because the control process exited with 
error code. See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
andrzej@andrzej-PC ~ $ systemctl status dnsmasq
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; disabled; vendor preset:
  Drop-In: /run/systemd/generator/dnsmasq.service.d
           └─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
   Active: failed (Result: exit-code) since Mon 2017-07-10 02:09:41 CEST; 3s ago
  Process: 5551 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=
  Process: 5548 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUC

Jul 10 02:09:41 andrzej-PC systemd[1]: Starting dnsmasq - A lightweight DHCP and
Jul 10 02:09:41 andrzej-PC dnsmasq[5548]: dnsmasq: syntax check OK.
Jul 10 02:09:41 andrzej-PC dnsmasq[5551]: dnsmasq: unknown interface enp2s0
Jul 10 02:09:41 andrzej-PC systemd[1]: dnsmasq.service: Control process exited, 
Jul 10 02:09:41 andrzej-PC systemd[1]: Failed to start dnsmasq - A lightweight D
Jul 10 02:09:41 andrzej-PC systemd[1]: dnsmasq.service: Unit entered failed stat
Jul 10 02:09:41 andrzej-PC systemd[1]: dnsmasq.service: Failed with result 'exit

다음을 제외하고는 정확합니다.

andrzej@andrzej-PC ~ $ ifconfig
enp2s0    Link encap:Ethernet  HWaddr /*correct address*/  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:921 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:147421 (147.4 KB)

그리고 같은 ip addr:

2: enp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether /*same*/ brd ff:ff:ff:ff:ff:ff

마침내:

andrzej@andrzej-PC ~ $ cat /sys/class/net/enp2s0/operstate
up

무엇? 아, 내 구성 파일은 다음과 같습니다.

port=0
interface=enp2s0
dhcp-range=192.168.0.50,192.168.0.150,12h
dhcp-boot=/install/netboot/pxelinux.0
dhcp-option-force=209,install/netboot/pxelinux.cfg
dhcp-option-force=210,/
dhcp-option-force=66,192.168.0.1
enable-tftp
tftp-root=/mnt

답변1

DNSMasq 서비스 설명 수정

sudo nano /lib/systemd/system/dnsmasq.service

인터페이스가 시작된 후 시작하려면 Requires 및 After를 변경하세요.

Requires=network-online.target
After=network-online.target

답변2

나는 동일한 상황에 직면했습니다. dnsmasq는 다른 시스템에 연속적으로(스위치 없음) 연결된 PXE에 사용되는 보조 eth 인터페이스에서 시작을 거부했습니다.

링크가 설정되면(일부 네트워크 트래픽, NIC 표시등 켜짐) dnsmasq가 제대로 작동하기 시작했습니다.

나는 그것이 매우 과학적이지는 않다는 것을 알고 있지만 그것은 나에게 효과적이었습니다 (Ubuntu 20.04)

답변3

시스템 재시작에 도움이 되었습니다. dnsmasq가 문제 없이 시작되었습니다. dnsmasq와 함께 사용하도록 구성된 인터페이스의 장치 구성이 아직 적용되지 않았을 수 있습니다.

답변4

Linux를 사용하는 경우 활성화할 수 있습니다.동적 바인딩. 문서에 따르면:

혼합 네트워크 모드 활성화--bind-interfaces 및 기본값. Dnsmasq는 주소를 개별 인터페이스에 바인딩하여 dnsmasq의 여러 인스턴스를 허용하지만 새 인터페이스나 주소가 나타나면 자동으로 이를 수신합니다(액세스 제어 구성에 따라 다름). 이렇게 하면 동적으로 생성된 인터페이스가 기본 인터페이스와 동일한 방식으로 작동하게 됩니다. 이 옵션을 구현하려면 비표준 네트워크 API가 필요하며 Linux에서만 사용할 수 있습니다. 다른 플랫폼에서는 다음으로 대체됩니다.--bind-interfaces모델.

삭제하는 것을 기억하세요바인딩 인터페이스.

인용하다:https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

관련 정보