Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/217.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在coreos中使用cloudconfig文件添加IP_Cloud_Coreos - Fatal编程技术网

在coreos中使用cloudconfig文件添加IP

在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

我正在使用cloudconfig文件向系统添加新的ip地址。但由于某些原因,它不会添加ip地址。有人能帮我吗

以下是我的cloudconfig文件的内容:

#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