CoreOS Network Interface Configuration
CoreOS, is different in the way it sets up it network addressing. The CoreOS image we are using for test all use DHCP and I manually change the network address to a static one for testing.
In order to change from DHCP to static, a file must be created called static.network and placed in the following folder /etc/systemd/network/
sudo vi /etc/systemd/network/static.network
[Match]
Name=ens192 (Virtual box eth0)
[Network]
Address=192.168.10.152/24
Gateway=192.168.10.254
DNS=8.8.8.8
Note. When creating the network address the network mask is appended on to the IP address with a / followed by 27 (192.168.180.101/27) in our case for our network mask, /24 for 255.255.255.0. See below.
After adding this file do the following at the command line
sudo systemctl restart systemd-networkd
You will have to start a new ssh session to the new IP address.
Note. When creating the network address the network mask is appended on to the IP address with a / followed by 27 (192.168.180.101/27) in our case for our network mask, /24 for 255.255.255.0. See below.
The default network interface name is ens192. If you wish to use a different interface you will need to check the name out and change it in the script.
You can change the networking interface back to DHCP by deleting this file.