VM1 <-----------------> VM2
network adpter1 network adpter1
I use udp tunnel connect two network card when the both side VM is running. If i connect and disconnect the two Adapter more than 3 times, sometimes I ping peer side VM failed.
my code is below
connect
Code: Select all
netadp = Session.getNetworkAdapter(0)
netadp.attachmentType = self.constants.NetworkAttachmentType_Generic
netadp.genericDriver = u"UDPTunnel"
netadp.setProperty(u"sport", str(iSrcPort))
netadp.setProperty(u"dest", str(daddr))
netadp.setProperty(u"dport", str(iDestPort))
Session.saveSettings()
disconnect
Code: Select all
netadp = Session.getNetworkAdapter(0)
netadp.genericDriver = u""
netadp.setProperty(u"sport", u"")
netadp.setProperty(u"dest", u"")
netadp.setProperty(u"dport", u"")
netadp.attachmentType = self.constants.NetworkAttachmentType_Null
Session.saveSettings()