In my SoC imx6 I have two 4G modems using two different operators. I would like to give a score to each one so I can detect the best interface for my critical application.
I decide to use a small application that can make a ping to a server via a specific port:
$ ./tcpclienttimeout --host google.com --port 80
hotsname:google.com:80 timeout:10s
socket google.com:80 connected. It took 23 milliseconds
23
I would like to target the same server but with two different ports (let's say port 5000 and 5001) to get the latency for each modem.
here is a schematic that describes what I need:
I was thinking to use ip route add
but we can specify just the servers and interfaces, not the port.
Now I think that the solution will be using iptables
(wich I don't understand at all)
thank you for your help.