Method: Rbeapi::Api::VxlanInterface#set_source_interface

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

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

Configures the vxlan source-interface to the specified value. This parameter should be a the interface identifier of the interface to act as the source for all Vxlan traffic



1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
# File 'lib/rbeapi/api/interfaces.rb', line 1146

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

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