-#!/usr/bin/env python
+#!/usr/bin/env python3
import socket
class IPSecNATTestCase(TemplateIpsec):
""" IPSec/NAT
- TUNNEL MODE:
+ TUNNEL MODE::
- public network | private network
- --- encrypt --- plain ---
- |pg0| <------- |VPP| <------ |pg1|
- --- --- ---
+ public network | private network
+ --- encrypt --- plain ---
+ |pg0| <------- |VPP| <------ |pg1|
+ --- --- ---
+
+ --- decrypt --- plain ---
+ |pg0| -------> |VPP| ------> |pg1|
+ --- --- ---
- --- decrypt --- plain ---
- |pg0| -------> |VPP| ------> |pg1|
- --- --- ---
"""
tcp_port_in = 6303
icmp_id_in = 6305
icmp_id_out = 6305
+ @classmethod
+ def setUpClass(cls):
+ super(IPSecNATTestCase, cls).setUpClass()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(IPSecNATTestCase, cls).tearDownClass()
+
def setUp(self):
super(IPSecNATTestCase, self).setUp()
self.tun_if = self.pg0
p = self.ipv4_params
self.config_esp_tun(p)
- self.logger.info(self.vapi.ppcli("show ipsec"))
+ self.logger.info(self.vapi.ppcli("show ipsec all"))
d = DpoProto.DPO_PROTO_IP6 if p.is_ipv6 else DpoProto.DPO_PROTO_IP4
VppIpRoute(self, p.remote_tun_if_host, p.addr_len,
[VppRoutePath(self.tun_if.remote_addr[p.addr_type],
0xffffffff,
- proto=d)],
- is_ip6=p.is_ipv6).add_vpp_config()
+ proto=d)]).add_vpp_config()
def tearDown(self):
super(IPSecNATTestCase, self).tearDown()