Network devices are now only managed by NetworkManager.
Systemd-networkd is no longer used. NetworkManager creates a MACVTAP device for each physical Ethernet device. When calling vm-run with option macvtap, all macvtap-devices are passed to the VM.
This commit is contained in:
parent
a8d74fce5b
commit
93d261e73b
4 changed files with 42 additions and 15 deletions
|
@ -215,29 +215,31 @@
|
|||
|
||||
- name: Configure macvtap interface
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/NetworkManager/system-connections/macvlan-vm-macvtap.nmconnection
|
||||
dest: "/etc/NetworkManager/system-connections/macvlan-vm-macvtap-{{ item }}.nmconnection"
|
||||
mode: '0600'
|
||||
content: |
|
||||
[connection]
|
||||
id=macvlan-vm-macvtap
|
||||
id=macvlan-macvtap-{{ item[3:9] }}
|
||||
type=macvlan
|
||||
interface-name=vm-macvtap
|
||||
interface-name=macvtap-{{ item[3:9] }}
|
||||
[macvlan]
|
||||
mode=2
|
||||
parent={{ ansible_default_ipv4['interface'] }}
|
||||
parent={{ item }}
|
||||
tap=true
|
||||
[ipv4]
|
||||
method=disabled
|
||||
[ipv6]
|
||||
method=disabled
|
||||
[proxy]
|
||||
loop: "{{ ansible_interfaces | select('search', '^enp.+') }}"
|
||||
|
||||
- name: Adjust interface permissions for user mode VMs
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/udev/rules.d/80-macvlan.rules
|
||||
content: |
|
||||
SUBSYSTEMS=="net", KERNELS=="vm-macvtap", MODE="0666"
|
||||
|
||||
{% for interface in (ansible_interfaces | select('search', '^enp.+')) %}
|
||||
SUBSYSTEMS=="net", KERNELS=="macvtap-{{ interface[3:9] }}", MODE="0666"
|
||||
{% endfor %}
|
||||
|
||||
- name: Create directory for local .desktop-Files
|
||||
ansible.builtin.file:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue