isc-dhcp-server 및 하위 인터페이스를 사용하여 "IPv4 주소 없음" 얻기

isc-dhcp-server 및 하위 인터페이스를 사용하여 "IPv4 주소 없음" 얻기

하위 인터페이스 및 보조 IP 주소 라우팅을 시도했지만 isc-dhcp-server에서는 둘 다 작동하지 않습니다. 올바른 IP를 얻기를 거부합니다. 저는 Debian 8 Jessie와 ISC-DHCP-SERVER 4.3.1을 사용하고 있습니다.

내/etc/네트워크/인터페이스

## Corporate Network
auto eth0
allow-hotplug eth0
iface eth0 inet manual

## New Subnet
auto eth0:0
allow-hotplug eth0:0
iface eth0:0 inet static
    address 10.0.0.2
    gateway 10.0.0.1
    netmask 255.255.0.0
    dns-nameservers 127.0.0.1 10.0.0.3
    dns-search example.net
    dns-domain example.net

## Old Subnet
auto eth0:1
allow-hotplug eth0:1
iface eth0:1 inet static
    address 10.136.136.253
    netmask 255.255.255.0

구성된 경우

eth0      Link encap:Ethernet  HWaddr b8:27:eb:c0:59:e5
          inet6 addr: fe80::ba27:ebff:fec0:59e5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:26688 errors:0 dropped:69 overruns:0 frame:0
          TX packets:7301 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7174565 (6.8 MiB)  TX bytes:1286716 (1.2 MiB)

eth0:0    Link encap:Ethernet  HWaddr b8:27:eb:c0:59:e5
          inet addr:10.0.0.2  Bcast:10.0.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth0:1    Link encap:Ethernet  HWaddr b8:27:eb:c0:59:e5
          inet addr:10.136.136.253  Bcast:10.136.136.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

IP 주소

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:eb:c0:59:e5 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.2/16 brd 10.0.255.255 scope global eth0:0
       valid_lft forever preferred_lft forever
    inet 10.136.136.253/24 brd 10.248.28.255 scope global eth0:1
       valid_lft forever preferred_lft forever
    inet6 fe80::ba27:ebff:fec0:59e5/64 scope link
       valid_lft forever preferred_lft forever

isc-dhcp-server를 시작할 때 /var/log/syslog

Aug 12 09:48:20 ns01 dhcpd: Wrote 0 deleted host decls to leases file.
Aug 12 09:48:20 ns01 dhcpd: Wrote 0 new dynamic host decls to leases file.
Aug 12 09:48:20 ns01 dhcpd: Wrote 5544 leases to leases file.
Aug 12 09:48:21 ns01 dhcpd:
Aug 12 09:48:21 ns01 dhcpd: No subnet declaration for eth0:1 (no IPv4 addresses).
Aug 12 09:48:21 ns01 dhcpd: ** Ignoring requests on eth0:1.  If this is not what
Aug 12 09:48:21 ns01 dhcpd:    you want, please write a subnet declaration
Aug 12 09:48:21 ns01 dhcpd:    in your dhcpd.conf file for the network segment
Aug 12 09:48:21 ns01 dhcpd:    to which interface eth0:1 is attached. **
Aug 12 09:48:21 ns01 dhcpd:
Aug 12 09:48:21 ns01 dhcpd:
Aug 12 09:48:21 ns01 dhcpd: No subnet declaration for eth0:0 (no IPv4 addresses).
Aug 12 09:48:21 ns01 dhcpd: ** Ignoring requests on eth0:0.  If this is not what
Aug 12 09:48:21 ns01 dhcpd:    you want, please write a subnet declaration
Aug 12 09:48:21 ns01 dhcpd:    in your dhcpd.conf file for the network segment
Aug 12 09:48:21 ns01 dhcpd:    to which interface eth0:0 is attached. **
Aug 12 09:48:21 ns01 dhcpd:
Aug 12 09:48:21 ns01 dhcpd: failover peer failover: I move from normal to startup
Aug 12 09:48:21 ns01 dhcpd: Server starting service.

답변1

따라서 이는 많은 사람들에게 당연할 수 있지만 먼저 관련 인터페이스의 DHCP 주소를 수동으로 설정해야 하며(저의 경우에는 eno1일반적으로 eth1), 수동 IP 주소는 의 설정과 일치해야 합니다 /etc/dhcp/dhcpd.conf. Ubuntu 22:04에서는 네트워크 설정을 사용하여 인터페이스를 통해 이 작업을 수행할 수 있습니다.

답변2

결국 다른 글에서 답을 찾았습니다. 서브넷 선언은 dhcpd.conf공유 네트워크 선언으로 래핑되어야 합니다.

shared-network vlan1 {
    subnet 10.0.0.0 netmask 255.255.0.0 {
        ....
    }

    subnet 10.136.136.0 netmask 255.255.255.0 {
        ....
    }
}

관련 정보