Why are my cloned linux VMs fighting for the same IP

Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I've cloned two vSphere VMs off of an Ubuntu 17.10 template. After boot, they both claim the same IP and fight for it (ssh connections break off as the IP switches between them).
The hostnames and MAC addresses are different between the two machines. dhclient correctly claims two separate IPs, but the resolver in use is systemd-networkd.
systemd virtual-machine dhcp systemd-networkd
add a comment |Â
up vote
2
down vote
favorite
I've cloned two vSphere VMs off of an Ubuntu 17.10 template. After boot, they both claim the same IP and fight for it (ssh connections break off as the IP switches between them).
The hostnames and MAC addresses are different between the two machines. dhclient correctly claims two separate IPs, but the resolver in use is systemd-networkd.
systemd virtual-machine dhcp systemd-networkd
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I've cloned two vSphere VMs off of an Ubuntu 17.10 template. After boot, they both claim the same IP and fight for it (ssh connections break off as the IP switches between them).
The hostnames and MAC addresses are different between the two machines. dhclient correctly claims two separate IPs, but the resolver in use is systemd-networkd.
systemd virtual-machine dhcp systemd-networkd
I've cloned two vSphere VMs off of an Ubuntu 17.10 template. After boot, they both claim the same IP and fight for it (ssh connections break off as the IP switches between them).
The hostnames and MAC addresses are different between the two machines. dhclient correctly claims two separate IPs, but the resolver in use is systemd-networkd.
systemd virtual-machine dhcp systemd-networkd
asked Jan 24 at 11:40
wickedchicken
1814
1814
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
6
down vote
systemd-networkd uses a different method to generate the DUID than dhclient. dhclient by default uses the link-layer address while systemd-networkd uses the contents of /etc/machine-id. Since the VMs were cloned, they have the same machine-id and the DHCP server returns the same IP for both.
To fix, replace the contents of one or both of /etc/machine-id. This can be anything, but deleting the file and running systemd-machine-id-setup will create a random machine-id in the same way done on machine setup.
2
See unix.stackexchange.com/questions/402999 for why that does not work, what one actually has to do, and what state the machine has to be in to do it.
â JdeBP
Jan 24 at 13:13
Interesting. Good catch. +1
â Rui F Ribeiro
Jan 24 at 19:01
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
6
down vote
systemd-networkd uses a different method to generate the DUID than dhclient. dhclient by default uses the link-layer address while systemd-networkd uses the contents of /etc/machine-id. Since the VMs were cloned, they have the same machine-id and the DHCP server returns the same IP for both.
To fix, replace the contents of one or both of /etc/machine-id. This can be anything, but deleting the file and running systemd-machine-id-setup will create a random machine-id in the same way done on machine setup.
2
See unix.stackexchange.com/questions/402999 for why that does not work, what one actually has to do, and what state the machine has to be in to do it.
â JdeBP
Jan 24 at 13:13
Interesting. Good catch. +1
â Rui F Ribeiro
Jan 24 at 19:01
add a comment |Â
up vote
6
down vote
systemd-networkd uses a different method to generate the DUID than dhclient. dhclient by default uses the link-layer address while systemd-networkd uses the contents of /etc/machine-id. Since the VMs were cloned, they have the same machine-id and the DHCP server returns the same IP for both.
To fix, replace the contents of one or both of /etc/machine-id. This can be anything, but deleting the file and running systemd-machine-id-setup will create a random machine-id in the same way done on machine setup.
2
See unix.stackexchange.com/questions/402999 for why that does not work, what one actually has to do, and what state the machine has to be in to do it.
â JdeBP
Jan 24 at 13:13
Interesting. Good catch. +1
â Rui F Ribeiro
Jan 24 at 19:01
add a comment |Â
up vote
6
down vote
up vote
6
down vote
systemd-networkd uses a different method to generate the DUID than dhclient. dhclient by default uses the link-layer address while systemd-networkd uses the contents of /etc/machine-id. Since the VMs were cloned, they have the same machine-id and the DHCP server returns the same IP for both.
To fix, replace the contents of one or both of /etc/machine-id. This can be anything, but deleting the file and running systemd-machine-id-setup will create a random machine-id in the same way done on machine setup.
systemd-networkd uses a different method to generate the DUID than dhclient. dhclient by default uses the link-layer address while systemd-networkd uses the contents of /etc/machine-id. Since the VMs were cloned, they have the same machine-id and the DHCP server returns the same IP for both.
To fix, replace the contents of one or both of /etc/machine-id. This can be anything, but deleting the file and running systemd-machine-id-setup will create a random machine-id in the same way done on machine setup.
answered Jan 24 at 11:40
wickedchicken
1814
1814
2
See unix.stackexchange.com/questions/402999 for why that does not work, what one actually has to do, and what state the machine has to be in to do it.
â JdeBP
Jan 24 at 13:13
Interesting. Good catch. +1
â Rui F Ribeiro
Jan 24 at 19:01
add a comment |Â
2
See unix.stackexchange.com/questions/402999 for why that does not work, what one actually has to do, and what state the machine has to be in to do it.
â JdeBP
Jan 24 at 13:13
Interesting. Good catch. +1
â Rui F Ribeiro
Jan 24 at 19:01
2
2
See unix.stackexchange.com/questions/402999 for why that does not work, what one actually has to do, and what state the machine has to be in to do it.
â JdeBP
Jan 24 at 13:13
See unix.stackexchange.com/questions/402999 for why that does not work, what one actually has to do, and what state the machine has to be in to do it.
â JdeBP
Jan 24 at 13:13
Interesting. Good catch. +1
â Rui F Ribeiro
Jan 24 at 19:01
Interesting. Good catch. +1
â Rui F Ribeiro
Jan 24 at 19:01
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f419321%2fwhy-are-my-cloned-linux-vms-fighting-for-the-same-ip%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password