remoteips=None,
learning='on',
ageing=None,
- anycastip=None):
+ anycastip=None,
+ ttl=None):
if svcnodeip and remoteips:
raise Exception("svcnodeip and remoteip is mutually exclusive")
args = ''
args += ' ageing %s' % ageing
if learning == 'off':
args += ' nolearning'
+ if ttl is not None:
+ args += ' ttl %s' % ttl
if self.link_exists(name):
cmd = 'link set dev %s type vxlan dstport %d' % (name, LinkUtils.VXLAN_UDP_PORT)
return False
@staticmethod
- def link_add_macvlan(ifname, macvlan_ifacename):
- utils.exec_commandl(['ip', 'link', 'add', 'link', ifname, 'name', macvlan_ifacename, 'type', 'macvlan', 'mode', 'private'])
+ def link_add_macvlan(ifname, macvlan_ifacename, mode):
+ utils.exec_commandl(['ip', 'link', 'add', 'link', ifname, 'name', macvlan_ifacename, 'type', 'macvlan', 'mode', mode])
@staticmethod
def route_add(route):
# is to flush our internal address cache
self.reset_addr_cache(ifname)
- cmd = 'link set dev %s addrgenmode %s' % (ifname, 'none' if addrgen else 'eui64')
+ cmd = 'link set dev %s addrgenmode %s' % (ifname, Link.ifla_inet6_addr_gen_mode_dict.get(addrgen))
is_link_up = self.is_link_up(ifname)
if is_link_up:
self.link_down(ifname)
- if LinkUtils.ipbatch:
- self.add_to_batch(cmd)
- else:
- utils.exec_command('%s %s' % (utils.ip_cmd, cmd))
+ #if LinkUtils.ipbatch:
+ # self.add_to_batch(cmd)
+ #else:
+ # because this command might fail on older kernel its better to not batch it
+ utils.exec_command('%s %s' % (utils.ip_cmd, cmd))
if is_link_up:
self.link_up(ifname)