在coreos中使用cloudconfig文件添加IP
我正在使用cloudconfig文件向系统添加新的ip地址。但由于某些原因,它不会添加ip地址。有人能帮我吗 以下是我的cloudconfig文件的内容:在coreos中使用cloudconfig文件添加IP,cloud,coreos,Cloud,Coreos,我正在使用cloudconfig文件向系统添加新的ip地址。但由于某些原因,它不会添加ip地址。有人能帮我吗 以下是我的cloudconfig文件的内容: #cloud-config coreos: coreos: units: - name: update-sysctl.service command: start content: | [Unit] Description=Update sysctl values writt
#cloud-config
coreos:
coreos:
units:
- name: update-sysctl.service
command: start
content: |
[Unit]
Description=Update sysctl values written by cloud-config
[Service]
Type=oneshot
ExecStart=ip addr add 172.31.118.62 dev eth0:1
ExecStart=ip addr add 172.31.118.63 dev eth0:2
ExecStart=ip addr add 172.31.118.64 dev eth0:3
实际上,我没有给出完整的命令路径,所以它不起作用。下面给出的配置是有效的
#cloud-config
coreos:
units:
- name: update-sysctl.service
command: start
content: |
[Unit]
Description=Update sysctl values written by cloud-config
[Service]
Type=oneshot
ExecStart=/bin/ip addr add 172.31.118.62 dev eth0:1
ExecStart=/bin/ip addr add 172.31.118.63 dev eth0:2
ExecStart=/bin/ip addr add 172.31.118.64 dev eth0:3