Method: Rbeapi::Api::VxlanInterface#set_multicast_group

Defined in:
lib/rbeapi/api/interfaces.rb

#set_multicast_group(name = 'Vxlan1', opts = {}) ⇒ Boolean

Configures the vxlan multcast-group flood address to the specified value. The value should be a valid multicast address

Parameters:

  • :name (String)

    The name of the interface to apply the configuration values to

  • :opt (Hash)

    Optional keyword arguments

  • :opts (Hash)

    a customizable set of options

Returns:

  • (Boolean)

    This method returns true if the commands were successful otherwise it returns false



1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
# File 'lib/rbeapi/api/interfaces.rb', line 1177

def set_multicast_group(name = 'Vxlan1', opts = {})
  value = opts[:value]
  default = opts.fetch(:default, false)

  cmds = ["interface #{name}"]
  case default
  when true
    cmds << 'default vxlan multicast-group'
  when false
    cmds << (value ? "vxlan multicast-group #{value}" : \
                     'no vxlan multtcast-group')
  end
  configure(cmds)
end