aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries')
-rw-r--r--resources/libraries/python/IPsecUtil.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/resources/libraries/python/IPsecUtil.py b/resources/libraries/python/IPsecUtil.py
index c109f417e5..4578b43987 100644
--- a/resources/libraries/python/IPsecUtil.py
+++ b/resources/libraries/python/IPsecUtil.py
@@ -821,10 +821,14 @@ class IPsecUtil(object):
'exec create loopback interface\n'
'exec set interface state loop0 up\n'
'exec set interface ip address {uifc} {iaddr}/{mask}\n'
+ 'exec set ip arp {uifc} {raddr}/32 {rmac} static\n'
.format(
iaddr=if2_ip - 1,
+ raddr=if2_ip,
uifc=Topology.get_interface_name(
nodes['DUT1'], if1_key),
+ rmac=Topology.get_interface_mac(
+ nodes['DUT2'], if2_key),
mask=96 if if2_ip.version == 6 else 24))
tmp_f2.write(
'exec set interface ip address {uifc} {iaddr}/{mask}\n'
@@ -968,6 +972,21 @@ class IPsecUtil(object):
err_msg = 'Failed to set IP address on interface {ifc} on host ' \
'{host}'.format(ifc=if1_key, host=nodes['DUT1']['host'])
papi_exec.add(cmd1, **args1).get_reply(err_msg)
+ cmd4 = 'ip_neighbor_add_del'
+ args4 = dict(
+ is_add=1,
+ neighbor=dict(
+ sw_if_index=Topology.get_interface_sw_index(
+ nodes['DUT1'], if1_key),
+ flags=1,
+ mac_address=str(
+ Topology.get_interface_mac(nodes['DUT2'], if2_key)),
+ ip_address=str(ip_address(unicode(if2_ip_addr)))
+ )
+ )
+ err_msg = 'Failed to add IP neighbor on interface {ifc}'.format(
+ ifc=if1_key)
+ papi_exec.add(cmd4, **args4).get_reply(err_msg)
# Configure IPsec tunnel interfaces
args1 = dict(
sw_if_index=loop_sw_if_idx,