This code is tested on Ubuntu 16.04.
Install scapy.
$ sudo apt-get install scapy
Dropping RST for the VIP.
$ sudo iptables -A OUTPUT -p tcp --tcp-flags RST RST -d 172.18.18.251 -j DROP
$ sudo python l3dsr.py
This client outputs only the payload of the first packet.
$ sudo python l3dsr.py
Sending SYN packet...
Waiting SYN/ACK packet...
Sending HTTP Request...
Waiting HTTP Response...
==========
HTTP/1.1 200 OK
Server: nginx/1.10.0 (Ubuntu)
Date: Tue, 21 Jun 2016 13:39:13 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Sun, 19 Jun 2016 04:00:37 GMT
Connection: close
ETag: "576618e5-264"
Accept-Ranges: bytes
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is succ
==========
Done