diff --git a/src/vnm_mad/remotes/lib/security_groups_iptables.rb b/src/vnm_mad/remotes/lib/security_groups_iptables.rb index 9d6c5f80707..1537eedef97 100644 --- a/src/vnm_mad/remotes/lib/security_groups_iptables.rb +++ b/src/vnm_mad/remotes/lib/security_groups_iptables.rb @@ -429,6 +429,14 @@ def self.nic_pre(vm, nic) ipv4s << nic[key] if !nic[key].nil? && !nic[key].empty? end + if !nic[:aliases].nil? && !nic[:aliases].empty? + nic[:aliases].each do |nicalias| + [:ip, :vrouter_ip].each do |key| + ipv4s << nicalias[key] if !nicalias[key].nil? && !nicalias[key].empty? + end + end + end + if !ipv4s.empty? #bootp commands.add :iptables, "-A #{chain_out} -p udp "\ @@ -456,6 +464,14 @@ def self.nic_pre(vm, nic) ipv6s << nic[key] if !nic[key].nil? && !nic[key].empty? end + if !nic[:aliases].nil? && !nic[:aliases].empty? + nic[:aliases].each do |nicalias| + [:ip6, :ip6_global, :ip6_link, :ip6_ula].each do |key| + ipv6s << nicalias[key] if !nicalias[key].nil? && !nicalias[key].empty? + end + end + end + if !ipv6s.empty? set = "#{vars[:chain]}-ip6-spoofing" diff --git a/src/vnm_mad/remotes/lib/vm.rb b/src/vnm_mad/remotes/lib/vm.rb index de3586857ee..c086bde60a2 100644 --- a/src/vnm_mad/remotes/lib/vm.rb +++ b/src/vnm_mad/remotes/lib/vm.rb @@ -50,6 +50,15 @@ def initialize(vm_root, xpath_filter, deploy_id) nic.get_tap(self) end + if !nic[:alias_ids].nil? + nic[:aliases] = [] + @vm_root.elements.each("TEMPLATE/NIC_ALIAS[PARENT_ID=\"#{nic[:nic_id]}\"]") do |nicalias_element| + nicalias = nics.new_nic + nic_build_hash(nicalias_element, nicalias) + nic[:aliases] << nicalias + end + end + nics << nic end