title: How to do ip spoofing/change source address/raw socket programming for UDP packets in java?
body: <p>I sent and received spoofed IP packets by using Linux kali tools hping3. Now I would like to send spoofed IP packets using java. I looked at these questions but could not find any good resource(existing links don't work) or working solution.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/2493384/how-to-fake-source-ip-address-of-a-udp-packet">How to fake source ip-address of a udp-packet?</a></li>
  <li><a href="https://stackoverflow.com/questions/10626262/spoof-source-ip-port-with-datagrampacket">Spoof source IP/Port with DatagramPacket</a></li>
  <li><a href="https://stackoverflow.com/questions/650825/creating-raw-packets-to-spoof-udp-packets">Creating raw packets to spoof UDP Packets</a></li>
  <li><a href="https://stackoverflow.com/questions/6204967/how-to-spoof-ip-in-java">How to Spoof ip in java</a></li>
  </ul>
  
  <p>Most of them have accepted answers but those answers solution do not work now. Most of those answers' solution links don't work like these links. </p>
  
  <ul>
  <li><a href="http://jnetpcap.com/" rel="nofollow noreferrer">http://jnetpcap.com/</a></li>
  <li><a href="http://netresearch.ics.uci.edu/kfujii/jpcap/doc/javadoc/jpcap/JpcapSender.html" rel="nofollow noreferrer">http://netresearch.ics.uci.edu/kfujii/jpcap/doc/javadoc/jpcap/JpcapSender.html</a></li>
  <li><a href="http://netresearch.ics.uci.edu/kfujii/jpcap/doc/" rel="nofollow noreferrer">http://netresearch.ics.uci.edu/kfujii/jpcap/doc/</a></li>
  </ul>
  
  <p>Additional information.
  My PC is Linux server(64 bit) and with 64 bit JDK. One solution worked for windows but does not work in Linux.</p>