python client
import socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
interface_name = "enp5s0f1"
client_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BINDTODEVICE , interface_name.encode())
addr = ("10.55.3.250", 60000)
try:
client_socket.connect(addr)
print("Connected to server.")
while True:
message = "hello world"
client_socket.send(message.encode("utf-8"))
if message == "close":
break
response = client_socket.recv(1024)
response = response.decode("utf-8")
print(f"Echo from server: {response}")
except BrokenPipeError:
print("Error: Broken pipe. The server may have closed the connection.")
except ConnectionRefusedError:
print("Error: Connection refused. Is the server running?")
except Exception as e:
print(f"An error occurred: {e}")
finally:
client_socket.close()
print("Socket closed.")
Wireshark of client and server
left:SYN of client, right:ACK of server
SO far, I tried :
- Disable the firewall so that iptables & firewalld say that it is inactive
- Tried statically linkining an ip to the port and using ip route
- Setting all rp_filter to 0 & the rx/tx-checksum to off
None of these work so im assuming there is a problem with my packet but from the looks of wireshark, it seems fine too. If anyone has any suggestions, do let me know.