RancherOS - How do I add a private IP address to the network config?

Hello,

I’m very sorry if this has been asked before but I’ve spent a good day on this and can’t seem to get it working. I have some servers set-up on Linode - 1 x Rancher server, 2 x hosts and 1 x NFS server(ubuntu). I’m trying to get my servers talking to the NFS server over private network only but I can’t find a way to add the private ip addresses to the server and hosts running RancherOS.

I’ve tried doing in using a cloud-config.yml and using the ros config command but not joy. Ifconfig only shows the public IP and the servers can’t speak to each other over the private network.

It would be great if someone could point me in the right direction. I’m out of ideas.

Thanks

Rob

I’ve just figured it out…I’ll stick my config below incase anybody else has this question.

ssh_authorized_keys:
    - ssh-rsa ...

rancher:
  network:
    interfaces:
      eth0:
        dhcp: false
        addresses:
        - xxx.xxx.xxx.xx/24  # Public IP
        - xxx.xxx.xxx.xxx/17  # Private IP
        gateway: xxx.xxx.xxx.x

        post_up:
            - ip addr add xxx.xxx.xxx.xxx/17 dev eth0 label eth0:1  # Private IP`
2 Likes