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では、ネットワーク設定を使用してインターフェイスを介してこれを行うことができます。

おすすめ記事