]> git.ipfire.org Git - ipfire-2.x.git/commit
Network: add macvtap mode
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Sat, 7 May 2016 14:01:08 +0000 (16:01 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 1 Jun 2016 21:22:29 +0000 (22:22 +0100)
commit7b616db4e2a2cdfb81c2e6cd1be0813747921905
tree28f5b5436b62c4fbe65b4f73cf7505ea55a7d01c
parent48396bdffedb612a8841bc26bf070c48ac66502f
Network: add macvtap mode

This change make it possible to use a macvtap interface as a
standard interface (green0).
This is required by libvirt, because libvirt adds macvtap interfaces to
the physical interface, but this causes a problem. A VM  with this
configuration can communicate with the whole network,
but not with the Host (IPFire).
To solve this problem, the host interface must be also a macvtap interface.
This is achieved by:
1. In /var/ipfire/ethernet/settings the mode of a interface could set
with GREEN_MODE= ...
When the mode is macvtap the physical interface is renamed to green0phys
instead of green0. If the mode is not set the normal configuration is
applied .
2. The  network-hotplug-macvtap script checks if a physical nic ends
with "phys".
When the interface ends with "phys", the script adds a macvtap interface
to the physical nic which is named green0. The MAC address of this
interface is set to the MAC address of the physical nic. The MAC address
of the physical is set to a random value. We do this because the MAC
address of green0 should not change.
All services, IP addresses then binds to the macvatap interface, the
physical nic is not used.
PS.:  The script works also with the orange or blue interface, just
replace green with orange or blue.

Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/common/udev
config/udev/60-net.rules
config/udev/network-hotplug-macvtap [new file with mode: 0644]
config/udev/network-hotplug-rename
lfs/udev