[Ovirt-devel] [PATCH] Add support for tagged VLAN
Arthur Clement
aclement at linagora.com
Wed Jul 21 09:54:51 UTC 2010
VLAN are supported with this patch from Patrick Guiran <pguiran at linagora.com>
Setup instructions coming soon (https://fedorahosted.org/ovirt/wiki/VLANSetup)
Signed-off-by: Arthur Clement <aclement at linagora.com>
---
src/lib/managed_node_configuration.rb | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/src/lib/managed_node_configuration.rb b/src/lib/managed_node_configuration.rb
index fac653b..47360c0 100644
--- a/src/lib/managed_node_configuration.rb
+++ b/src/lib/managed_node_configuration.rb
@@ -95,6 +95,21 @@ class ManagedNodeConfiguration
nic.netmask, nic.broadcast,
nic.gateway)
add_nic(result, nic.mac, iface_name)
+
+ # process the vlan tagging
+
+ nic.network.usages.map do |usage|
+ usage.networks.map do |net|
+ if net.type == "Vlan"
+ eth_vlan_name = "#{nic.interface_name}.#{net.number}"
+ add_bridge(result, 'none', eth_vlan_name,
+ nic.boot_protocol, nic.ip_address,
+ nic.netmask, nic.broadcast,
+ nic.gateway)
+ add_vlan(result, eth_vlan_name)
+ end
+ end # end of : usage.networks.map do |net|
+ end # end of : nic.network.usages.map do |usage|
end
end
end
@@ -121,4 +136,9 @@ class ManagedNodeConfiguration
def self.add_slave(result, mac, iface_name, master)
result.puts "ifcfg=#{mac}|#{iface_name}|MASTER=#{master}|SLAVE=yes|ONBOOT=yes"
end
+
+ def self.add_vlan(result, iface_name)
+ result.puts "ifcfg=none|#{iface_name}|BRIDGE=br#{iface_name}|ONBOOT=yes|VLAN=yes"
+ end
+
end
--
1.7.1
More information about the ovirt-devel
mailing list