title: Scapy - persistent RandIP
body: <p>I am trying to simulate a TCP communication between two hosts with scapy.</p>
  
  <p>My problem is, that I can't save the random IP addresses scapy generates for me.</p>
  
  <p>This code</p>
  
  <pre><code>src_IP = RandIP()
  
  print(src_IP)
  print(src_IP)
  print(src_IP)
  </code></pre>
  
  <p>gives me an output like this</p>
  
  <pre><code>234.200.98.20
  147.3.56.17
  135.102.142.49
  </code></pre>
  
  <p>So every time I access <code>src_IP</code> it has a new value.</p>
  
  <p>Is there a way to save a random IP from scapy? So I could generated 2 IPs at the beginning of my function and use them as source and destination for my TCP communication.<br>
  I could generate the IPs myself, but I thought there had to be a more elegant solution to it.  </p>
  
  <p>BTW. non of the packets are going to be sent, they will be written into a PCAP file. Therefor I have to create both sides of the communication.</p>