I downloaded CentOS Atomic Host from here and installed in VirtualBox VM with Bridged adapter as the network adapter. Default installation and I only setup root password and nothing else. Then I logged in the VM and ran the command systemctl enable cloud-init
to initialize my instance and reboot
.
The user-data and meta-data files of cloud-init are as follows:
#meta-data | #user-data
--------------------------------------------------------------------------------
instance-id: magicatomic | #cloud-config
local-hostname: ss.magicatomic | groups:
network-interfaces: | | - docker: [root]
auto enp0s3 | write_files:
iface enp0s3 inet static | - content: |
address 192.168.1.110 | {
network 192.168.1.0 | "debug": true,
netmask 255.255.255.0 | "hosts": ["tcp://192.168.1.110:2375"]
broadcast 192.168.1.255 | }
gateway 192.168.1.1 | path: /etc/docker/daemon.json
| runcmd:
| - sudo systemctl daemon-reload
| - sudo systemctl restart docker.service
But the configuration is half broken, meaning:
Default Gateway is not set and Protocol is not set to static in /etc/sysconfig/network-scripts/ifcfg-enp0s3
When I do cat /etc/sysconfig/network-scripts/ifcfg-enp0s3
I get
BOOTPROTO=none
DEVICE=enp0s3
IPADDR=192.168.1.110
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=ethernet
USERCTL=no
And when I do route -n
Kernel IP Routing Table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
192.168.1.0 0.0.0.0 255.255.255.0 U 100 0 0 enp0s3
QUESTION: No Default Gateway is set