
나는 다음에 두 개의 하위 인터페이스를 만들었습니다 eth0
.
eth0:0
IP로192.168.10.1/24
eth0:1
IP로192.168.11.1/24
다음과 같이 구성되었습니다 /etc/dhcp/dhcpd.conf
.
option domain-name-server 194.204.159.1;
subnet 192.168.10.0 netmask 255.255.255.0 {
option routers 192.168.10.1;
option subnet-mask 255.255.255.0;
range 192.168.10.10 192.168.10.100;
}
subnet 192.168.11.0 netmask 255.255.255.0 {
option routers 192.168.11.1;
option subnet-mask 255.255.255.0;
range 192.168.11.10 192.168.11.100;
}
그러나 DHCP 서버를 시작하려고 하면 다음과 같은 메시지가 나타납니다.
No subnet declaration for eth0:0 (no IPv4 addresses).
** Ignoring requests on eth0:0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0:0 is attached. **
No subnet declaration for eth0:1 (no IPv4 addresses).
** Ignoring requests on eth0:1. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0:1 is attached. **
구성 /etc/default/isc-dhcp-server
:
INTERFACES="eth0:0 eth0:1"
그게 뭐가 문제야?
업데이트:
하위 인터페이스(별칭?)에서 라우터 온 스틱을 구성하려고 한다는 사실을 잊어버렸습니다. 하위 인터페이스가 있는 세 번째 호스트를 구성한 후 192.168.10.2
2 개의 호스트를 설정하고 이 2개의 호스트 간에 패킷을 전달합니다. 하지만 지금은 2개의 서브넷에 있는 2개의 호스트에 IP를 동적으로 할당할 수 있는 DHCP 서버를 구성하려고 합니다.192.168.11.2
eth0:0
eth0:1
답변1
IP 앨리어싱은 기존 인터페이스에 주소를 추가하는 방법일 뿐이므로 이는 작동하지 않습니다. 여기서 해야 할 일은 VLAN입니다.
답변2
해당 네트워크에 대한 DHCP 요청을 처리하기 위해 하위 인터페이스가 필요하지 않습니다. http://manpages.ubuntu.com/manpages/hardy/man5/dhcpd.conf.5.html
DHCP는 TCP/IP와 같은 프로토콜이므로 시스템이 IP 주소를 갖기도 전에 수준에서 작동하므로 DHCP 요청을 하위 인터페이스에서 수신할 필요가 없으며 실제 물리적 인터페이스를 수신하려고 합니다. , 해당 요청의 경우 eth0일 가능성이 높습니다.
그런 다음 정적 MAC 주소 매핑이나 우분투에서 허용하는 모든 방법을 통해 해당 그룹에 IP 주소를 임대하기 위한 규칙을 정의해야 합니다.
eth0:1 및 eth0:0 인터페이스는 NAT 라우팅에만 필요하며 DHCP 구성 어디에도 나타나서는 안 됩니다.