I have a debian server with one incoming interface (eth1) and three modems (modem1, modem2, modem3). There's an instance of squid on this server, listening on three consecutive ports (3128, 3129, 3130 to be specific).
I was able to set up to route all packets coming from eth1 to one of the modems, but I need to route packets based on which port the client is connected to. E.g., if client uses 192.168.138.2:3128 as a proxy, then route his packets through 192.168.6.1, which is modem1's ip address. Is it possible?
I do no require step-by-step solution, I'll be happy just with a term to google or something like this, because currently I'm just stuck.