Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

LXD, how to assign networks-to-profiles-to-instance?

$
0
0
I'm having an issue trying to get instances to talk to each other. I create two LXD neworks.

Code:

$ lxc network create lanA ipv4.address=192.168.1.1/24 ipv6.address=none ipv4.dhcp=true
$ lxc network create wanA ipv4.address=10.10.10.1/24 ipv6.address=none

I then create a profile for each instance type. The first, I'm trying to get ip's on two different interfaces, one for the local lan, and a second to route across a simulated wan (not yet created).

Code:

$ lxc profile create profile1
$ lxc profile device add profile1 root disk path=/ pool=default
$ lxc profile device add profile1 intA nic name=enp1s0 network=lanA
$ lxc profile device add profile1 intB nic name=enp2s0 network=wanA

On the second, just a single interface.
Code:

$ lxc profile create profile2
$ lxc profile device add profile2 root disk path=/ pool=default
$ lxc profile device add profile2 intA nic name=enp1s0 network=lanA

I then launch two instances with these profiles.

Code:

$ lxc launch ubuntu:20.04 instB --profile profile2
$ lxc launch ubuntu:20.04 instA --profile profile1

The problem is that when I run `lxc list`, I don't see any ip's in the IPV4 column. Is this not a valid use of profiles? If I could get this to work, then I would create a wanB, lanB just like lanA and wanA, and have a lanA-wanA-wanB-lanB routed network which is my goal.

Thanks for any help.

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>