I think I might be missing something simple, but I'm at the point of needing some extra eyes on the problem. I have a need for 2 separate networks to be on the same NIC (eth1): 192.168.0.0/24 and 192.168.1.0/24. The interfaces are:
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.250 netmask 255.255.255.0 broadcast 192.168.1.255
ether 0c:c4:7a:7d:bb:f8 txqueuelen 1000 (Ethernet)
RX packets 24515 bytes 5405247 (5.1 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 31116 bytes 3036051 (2.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xdf200000-df220000
eth1:1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.250 netmask 255.255.255.0 broadcast 192.168.0.255
ether 0c:c4:7a:7d:bb:f8 txqueuelen 1000 (Ethernet)
device interrupt 16 memory 0xdf200000-df220000
In /etc/sysconfig/dhcpd I have
DHCPD_INTERFACE="eth1 eth1:1"
DHCPDARGS="eth1 eth1:1"
In /etc/dhcpd.conf I have
subnet 192.168.0.0 netmask 255.255.255.0 {
pool {
....
}
}
subnet 192.168.1.0 netmask 255.255.255.0 {
pool {
....
}
}
Yet, when I start dhcpd, I see this
$ sudo journalctl -xeu dhcpd.service
....
dhcpd[5113]: No subnet declaration for eth1:1 (no IPv4 addresses).
dhcpd[5113]: ** Ignoring requests on eth1:1. If this is not what
dhcpd[5113]: you want, please write a subnet declaration
dhcpd[5113]: in your dhcpd.conf file for the network segment
dhcpd[5113]: to which interface eth1:1 is attached. **
....
Why?
eth1? That works perfectly fine on my system.ifconfigdid not show both addresses but I could ping them (curious). I was using these: ostechnix.com/…. However, I did run into similar issues with dhcpd though not the one listed above. Specifically, dhcpd would not vend addresses on the second network assigned.ifconfighas been written for obsolete APIs and has no understanding of multiple IP addresses per interface – even though Linux in general and modern tools (such asip addr) have supported that for many years. Do not use ifconfig on Linux.subnetdeclarations inside ashared-networkdeclaration for eth1?