Two subnet, two interfaces... using macvlan?

Hi everyone,

I’ve an Ubuntu 16.04.5 LTS host running Lxc 2.0.11, with two network interfaces to reach two different subnets. In this moment I’m using this settings custom template:

lxcbr0          8000.00163e000000       no             veth5QEGB5
                                                                             vetha9c90c84
lxcbr1          8000.a64ec9f7da73       no              veth2609861c
                                                                            vethKXKDB0

and this default settings:

config:
  environment.http_proxy: ""
  user.network_mode: ""
description: Default LXD profile
devices:
  eth0:
    name: eth0
    nictype: macvlan
    parent: eno1
    type: nic
  eth1:
    nictype: bridged
    parent: lxcbr1
    type: nic
name: lanprofile
used_by: []

On the guest Ubuntu I’ve two network interfaces:

  • eth0 is static and works fine for the first subnet;
  • eth1 is configured to use DHCP, an IP address was assegned correctly;

I configured the default gateway to use eth0 and a new route to reach the second subnet using eth1… but the second subnet is unreacheable.

Some ideas? :slight_smile:
Thank you very much

Hi!

A note here: It looks like you are using LXD but there are many references to LXC 1.0 (for example, lxcbr0 instead of lxdbr0, 2.0.11 is the latest version of LXD/deb in Ubuntu 18.04). Is there a chance that you are using both LXC 1.0 and LXD commands at the same time?

Yes, it’s possible! :frowning:
Now I’m using a new profile

devices:
eth0:
name: eth0
nictype: macvlan
parent: eno1
type: nic
eth1:
name: eth1
nictype: bridged
parent: lxdbr0
type: nic

I shutdown lxcbr0 and lxcbr1 interfaces, I added some rows (up route del, up route add…) into “/etc/network/interfaces.d/50-cloud-init.cfg” and It seem works fine! Yeah! :slight_smile:

Great! I am glad it worked.