[1/6] Network: add macvtap mode
Message ID | 1462629673-878-2-git-send-email-jonatan.schlag@ipfire.org |
---|---|
State | Accepted |
Commit | 7b616db4e2a2cdfb81c2e6cd1be0813747921905 |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (hedwig.ipfire.org [172.28.1.200]) by web02.ipfire.org (Postfix) with ESMTP id 9240662917 for <patchwork@ipfire.org>; Sat, 7 May 2016 15:55:33 +0200 (CEST) Received: from mail01.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 1C0481589; Sat, 7 May 2016 15:55:26 +0200 (CEST) Received: from fangorn.local.familyschlag (dslb-088-073-221-248.088.073.pools.vodafone-ip.de [88.73.221.248]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 9128814B6; Sat, 7 May 2016 15:55:03 +0200 (CEST) From: Jonatan Schlag <jonatan.schlag@ipfire.org> To: development@lists.ipfire.org Subject: [PATCH 1/6] Network: add macvtap mode Date: Sat, 7 May 2016 16:01:08 +0200 Message-Id: <1462629673-878-2-git-send-email-jonatan.schlag@ipfire.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1462629673-878-1-git-send-email-jonatan.schlag@ipfire.org> References: <1462629673-878-1-git-send-email-jonatan.schlag@ipfire.org> X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <http://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <http://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Message
Jonatan Schlag
May 8, 2016, 12:01 a.m. UTC
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>
---
config/rootfiles/common/udev | 1 +
config/udev/60-net.rules | 3 +++
config/udev/network-hotplug-macvtap | 46 +++++++++++++++++++++++++++++++++++++
config/udev/network-hotplug-rename | 11 +++++++--
lfs/udev | 2 ++
5 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 config/udev/network-hotplug-macvtap