Currently the juju machines are set a IP from DHCP. I would like to set a static IP so that it doesn’t change; do I just SSH into the machine and modify the /etc/network/interfaces?
Edit:
I found bionical is using netplan instead of ifupdown, but this “doesn’t persist accross instances”: cat /etc/netplan/50-cloud-init.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens192:
dhcp4: true
match:
macaddress: <MAC>
set-name: ens192
modifed /etc/netplan/50-cloud-init.yaml (shown below), not sure if this is the right way to do it but communications still work between machines. juju status shows wrong dns entries/public address for a while but eventually updates.
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens192:
match:
macaddress: <mac>
set-name: ens192
addresses:
- 192.168.1.10/24
gateway4: 192.168.1.1
nameservers:
search: [<domain>]
addresses: [192.168.1.2,192.168.1.3]
It would depend heavily on the provider.
For example, if you are running on AWS, you’d have to use the dashboard to request a fixed IP address. As AWS won’t allow routing traffic to an IP address that it doesn’t understand.
If you are talking about MAAS, it already has support for defining static addresses for machines.
VMWare is a bit more tricky, as we only currently support DHCP based, because VMWare itself doesn’t seem to have support for defining static addresses for machines. In that case, editing /etc/netplan probably is the most straightforward way. Juju itself shouldn’t rewrite the file after starting.
I’ve encountered a problem where etcd certificate won’t update to the new IP
failed to check the health of member 1edf4e6f9264548 on https://192.168.1.73:2379: Get https://192.168.1.73:2379/health: x509: certificate is valid for 192.168.1.147, not 192.168.1.73