X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FIPsecUtil.py;h=61ad001b0fddc084d590717de68d9a2d9410dc07;hp=a554a54bb42d67a50c74ee07cae9437eff7626f0;hb=2cc797fa23da02eefa19637521098ec41622189b;hpb=b52c43bd354ee658d4f955995a08073a1338e898 diff --git a/resources/libraries/python/IPsecUtil.py b/resources/libraries/python/IPsecUtil.py index a554a54bb4..61ad001b0f 100644 --- a/resources/libraries/python/IPsecUtil.py +++ b/resources/libraries/python/IPsecUtil.py @@ -486,15 +486,18 @@ class IPsecUtil(object): @staticmethod def vpp_ipsec_create_tunnel_interfaces(node1, node2, if1_ip_addr, - if2_ip_addr, n_tunnels, crypto_alg, - crypto_key, integ_alg, integ_key, - raddr_ip1, raddr_ip2, raddr_range): + if2_ip_addr, if1_key, if2_key, + n_tunnels, crypto_alg, crypto_key, + integ_alg, integ_key, raddr_ip1, + raddr_ip2, raddr_range): """Create multiple IPsec tunnel interfaces between two VPP nodes. :param node1: VPP node 1 to create tunnel interfaces. :param node2: VPP node 2 to create tunnel interfaces. :param if1_ip_addr: VPP node 1 interface IP4 address. :param if2_ip_addr: VPP node 2 interface IP4 address. + :param if1_key: VPP node 1 interface key from topology file. + :param if2_key: VPP node 2 interface key from topology file. :param n_tunnels: Number of tunnell interfaces to create. :param crypto_alg: The encryption algorithm name. :param crypto_key: The encryption key string. @@ -510,6 +513,8 @@ class IPsecUtil(object): :type node2: dict :type if1_ip_addr: str :type if2_ip_addr: str + :type if1_key: str + :type if2_key: str :type n_tunnels: int :type crypto_alg: CryptoAlg :type crypto_key: str @@ -569,6 +574,14 @@ class IPsecUtil(object): dut2_rte_s = 'ip route add {0}/{1} via {2} {3}\n'.format( raddr_ip1_s, raddr_range, if1_ip_addr, if_s) tmp_f2.write(dut2_rte_s) + dut1_if = Topology.get_interface_name(node1, if1_key) + dut1_unnum_s = 'set interface unnumbered {0} use {1}\n'.format( + if_s, dut1_if) + tmp_f1.write(dut1_unnum_s) + dut2_if = Topology.get_interface_name(node2, if2_key) + dut2_unnum_s = 'set interface unnumbered {0} use {1}\n'.format( + if_s, dut2_if) + tmp_f2.write(dut2_unnum_s) up_s = 'set int state {0} up\n'.format(if_s) tmp_f1.write(up_s) tmp_f2.write(up_s)