Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 1 character in body
Source Link
vivi
  • 131
  • 1
  • 4

I would like to create a nspawn container connected to the network via macvlan and dhcp. All documentation I have found were very instructive but did not offer a step by step procedure for this setup.

What I did so far was to create the container (debian base) using debootstrap including systemd-container:

debootstrap --arch=armhf --include=systemd-container stretch /var/lib/machines/raspbian-09 http://archive.raspbian.org/raspbian 

Native host network

running:

systemd-nspawn -b -M raspbian-09 

or creating

machinectl raspbian-09 

with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] Private=no VirtualEthernet=no 

and

machinectl raspbian-09 

TheIn both cases, the network connection is fine.

Macvlan

For the macvlan, I either run the command:

systemd-nspawn -b -M raspbian-09 --network-macvlan=eth0 

or

machinectl raspbian-09 

with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] MACVLAN=eth0 

and

machinectl raspbian-09 

TheIn both cases, the connection to the network does not work.

Within the container, I can see that an interface mv-eth0 is created:

# ip anetworkctl mv-eth0:IDX <BROADCAST,MULTICAST,UP,LOWER_UP>LINK mtu 1500 qdisc noqueue state UP group default qlen 1000  TYPE link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff link-netnsid 0  inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link    OPERATIONAL SETUP valid_lft   forever preferred_lft1 forever 

and

#lo networkctl IDX LINK TYPEloopback carrier OPERATIONAL SETUPunmanaged    2 mv-eth0    1 lo ether loopback degraded configuring 

however, there is no ipv4 address:

# ip carriera mv-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc unmanagednoqueue   state UP 2group mv-eth0default qlen 1000  link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff etherlink-netnsid 0  inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link    degraded valid_lft forever preferred_lft configuringforever 

but the interface does not get ipv4 address.

What other configurations on the host and container should be made?

I would like to create a nspawn container connected to the network via macvlan and dhcp. All documentation I have found were very instructive but did not offer a step by step procedure for this setup.

What I did so far was to create the container (debian base) using debootstrap including systemd-container:

debootstrap --arch=armhf --include=systemd-container stretch /var/lib/machines/raspbian-09 http://archive.raspbian.org/raspbian 

Native host network

running:

systemd-nspawn -b -M raspbian-09 

or creating the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] Private=no VirtualEthernet=no 

and

machinectl raspbian-09 

The network connection is fine.

Macvlan

For the macvlan, I either run the command:

systemd-nspawn -b -M raspbian-09 --network-macvlan=eth0 

or with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] MACVLAN=eth0 

and

machinectl raspbian-09 

The connection to the network does not work.

Within the container, I can see that an interface mv-eth0 is created:

# ip a mv-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000  link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff link-netnsid 0  inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link    valid_lft forever preferred_lft forever 

and

# networkctl IDX LINK TYPE OPERATIONAL SETUP    1 lo loopback carrier unmanaged    2 mv-eth0 ether degraded configuring 

but the interface does not get ipv4 address.

What other configurations on the host and container should be made?

I would like to create a nspawn container connected to the network via macvlan and dhcp. All documentation I have found were very instructive but did not offer a step by step procedure for this setup.

What I did so far was to create the container (debian base) using debootstrap including systemd-container:

debootstrap --arch=armhf --include=systemd-container stretch /var/lib/machines/raspbian-09 http://archive.raspbian.org/raspbian 

Native host network

running:

systemd-nspawn -b -M raspbian-09 

or

machinectl raspbian-09 

with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] Private=no VirtualEthernet=no 

In both cases, the network connection is fine.

Macvlan

For the macvlan, I either run the command:

systemd-nspawn -b -M raspbian-09 --network-macvlan=eth0 

or

machinectl raspbian-09 

with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] MACVLAN=eth0 

In both cases, the connection to the network does not work.

Within the container, I can see that an interface mv-eth0 is created:

# networkctl IDX LINK TYPE OPERATIONAL SETUP    1 lo loopback carrier unmanaged    2 mv-eth0 ether degraded configuring 

however, there is no ipv4 address:

# ip a mv-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000  link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff link-netnsid 0  inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link    valid_lft forever preferred_lft forever 

What other configurations on the host and container should be made?

edited body; edited title
Source Link
vivi
  • 131
  • 1
  • 4

systemd-nspawn/machinectl and macvlan

I would like to create a nspawn container connected to the network via macvlan and dhcp. All documentation I have found were very instructive but did not offer a step by step procedure for this setup.

What I did so far was to create the container (debian base) using debootstrap including systemd-container:

debootstrap --arch=armhf --include=systemd-container stretch /var/lib/machines/raspbian-09 http://archive.raspbian.org/raspbian 

Native host network

running:

systemd-nspawn -b -M raspbian-09 

or creating the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] Private=no VirtualEthernet=no 

and

machinectl raspbian-09 

The network connection is fine.

Macvlan

For the macvlan, I either run the command:

systemd-nspawn -b -M raspbian-09 --network-macvlan=eth0 

or with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] MACVLAN=eth0 

and

machinectl raspbian-09 

The connection to the network does not work.

insideWithin the container, I can see that an interface mv-eth0 is created:

# ip a mv-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link valid_lft forever preferred_lft forever 

and

# networkctl IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 mv-eth0 ether degraded configuring 

but the interface does not get ipv4 address.

What other configurations on the host and container should be made?

systemd-nspawn macvlan

I would like to create a nspawn container connected to the network via macvlan and dhcp. All documentation I have found were very instructive but did not offer a step by step procedure for this setup.

What I did so far was to create the container (debian base) using debootstrap including systemd-container:

debootstrap --arch=armhf --include=systemd-container stretch /var/lib/machines/raspbian-09 http://archive.raspbian.org/raspbian 

Native host network

running:

systemd-nspawn -b -M raspbian-09 

or creating the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] Private=no VirtualEthernet=no 

and

machinectl raspbian-09 

The network connection is fine.

Macvlan

For the macvlan, I either run the command:

systemd-nspawn -b -M raspbian-09 --network-macvlan=eth0 

or with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] MACVLAN=eth0 

and

machinectl raspbian-09 

The connection to the network does not work.

inside the container, I can see that an interface mv-eth0 is created:

# ip a mv-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link valid_lft forever preferred_lft forever 

and

# networkctl IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 mv-eth0 ether degraded configuring 

but the interface does not get ipv4 address.

What other configurations on the host and container should be made?

systemd-nspawn/machinectl and macvlan

I would like to create a nspawn container connected to the network via macvlan and dhcp. All documentation I have found were very instructive but did not offer a step by step procedure for this setup.

What I did so far was to create the container (debian base) using debootstrap including systemd-container:

debootstrap --arch=armhf --include=systemd-container stretch /var/lib/machines/raspbian-09 http://archive.raspbian.org/raspbian 

Native host network

running:

systemd-nspawn -b -M raspbian-09 

or creating the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] Private=no VirtualEthernet=no 

and

machinectl raspbian-09 

The network connection is fine.

Macvlan

For the macvlan, I either run the command:

systemd-nspawn -b -M raspbian-09 --network-macvlan=eth0 

or with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] MACVLAN=eth0 

and

machinectl raspbian-09 

The connection to the network does not work.

Within the container, I can see that an interface mv-eth0 is created:

# ip a mv-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link valid_lft forever preferred_lft forever 

and

# networkctl IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 mv-eth0 ether degraded configuring 

but the interface does not get ipv4 address.

What other configurations on the host and container should be made?

Source Link
vivi
  • 131
  • 1
  • 4

systemd-nspawn macvlan

I would like to create a nspawn container connected to the network via macvlan and dhcp. All documentation I have found were very instructive but did not offer a step by step procedure for this setup.

What I did so far was to create the container (debian base) using debootstrap including systemd-container:

debootstrap --arch=armhf --include=systemd-container stretch /var/lib/machines/raspbian-09 http://archive.raspbian.org/raspbian 

Native host network

running:

systemd-nspawn -b -M raspbian-09 

or creating the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] Private=no VirtualEthernet=no 

and

machinectl raspbian-09 

The network connection is fine.

Macvlan

For the macvlan, I either run the command:

systemd-nspawn -b -M raspbian-09 --network-macvlan=eth0 

or with the unit file /etc/systemd/nspawn/raspbian-09.nspawn containing:

[Exec] Boot=true PrivateUsers=no [Network] MACVLAN=eth0 

and

machinectl raspbian-09 

The connection to the network does not work.

inside the container, I can see that an interface mv-eth0 is created:

# ip a mv-eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000 link/ether xx:xx:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff link-netnsid 0 inet6 xxxx::xxxx:xxxx:xxxx:xxxx/64 scope link valid_lft forever preferred_lft forever 

and

# networkctl IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 mv-eth0 ether degraded configuring 

but the interface does not get ipv4 address.

What other configurations on the host and container should be made?