You need DHCP
server in you lan
network or on router to assign ip parm
to your servers.
You can do this with Ubuntu
server.
To install dhcp
service on server run command below
sudo apt install isc-dhcp-server
Change configuration based on your ip/mac address
sudo nano /etc/dhcp3/dhcpd.conf
EDIT 1 - added configuration for second dhcp
pool on different card
Cconfiguration example
subnet 192.168.100.0 netmask 255.255.255.0 {
interface eth0;
option domain-name "domain.net";
option broadcast-address 192.168.100.255;
option routers 192.168.100.1;
option domain-name-servers 192.168.100.1, 8.8.8.8;
# Define the scopes for this DHCP pool
pool {
range 192.168.100.2 192.168.100.200;
# static reserve = 192.168.100.201 - 192.168.100.254
}
host static-custid {
hardware ethernet 00:01:02:03:04:05;
fixed-address 192.168.100.205;
}
host static-custid {
hardware ethernet 00:01:02:03:04:06;
fixed address 192.168.100.206;
}
}
subnet 10.0.0.0 netmask 255.255.255.0 {
interface eth2;
default-lease-time 6000;
max-lease-time 7200;
range 10.0.0.100 10.0.0.200;
option subnet-mask 255.255.255.0;
option routers 10.0.0.254;
option broadcast-address 10.0.0.255;
}
Note: You dhcp
pool is from 192.168.100.2 192.168.100.200
, your netmask is 255.255.255.0
your router is on address 192.168.100.1
. DHCP server will always assign Host with mac address 00:01:02:03:04:05
ip 192.168.100.205
, with mac 00:01:02:03:04:06
ip 192.168.100.206
. But if come host with mac 00:01:02:03:04:08
server will assign next free ip address from pool.
After change of config, restart dhcp server.