1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-27 03:21:29 +03:00

feature #4043: Support TTL for VXLAN driver

(cherry picked from commit 31d26e0536)
This commit is contained in:
Ruben S. Montero 2015-10-09 15:56:18 +02:00
parent 7def22f7fb
commit e335542ed3
2 changed files with 4 additions and 1 deletions

View File

@ -34,3 +34,5 @@
# Base multicast address for each VLAN. The mc address is :vxlan_mc + :vlan_id
:vxlan_mc: 239.0.0.0
# Time To Live (TTL) should be > 1 in routed multicast networks (IGMP)
:vxlan_ttl: 16

View File

@ -45,9 +45,10 @@ class VXLANDriver < VNMMAD::VLANDriver
mc = VNMMAD::VNMNetwork::IPv4.to_i(CONF[:vxlan_mc]) + @nic[:vlan_id].to_i
mcs = VNMMAD::VNMNetwork::IPv4.to_s(mc)
mtu = @nic[:mtu] ? "mtu #{@nic[:mtu]}" : ""
ttl = CONF[:vxlan_ttl] ? "ttl #{CONF[:vxlan_ttl]}" : ""
OpenNebula.exec_and_log("#{command(:ip)} link add #{@nic[:vlan_dev]}"\
" #{mtu} type vxlan id #{@nic[:vlan_id]} group #{mcs}"\
" #{mtu} type vxlan id #{@nic[:vlan_id]} group #{mcs} #{ttl}"\
" dev #{@nic[:phydev]}")
OpenNebula.exec_and_log("#{command(:ip)} link set #{@nic[:vlan_dev]} up")