Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month, online, via Jitsi Meet.

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss] Limit the number of ip addresses which can connect to a port



> From: Tom Luo <mariolzx at gmail.com>
>
> Yes. I want only one IP gets access to the service. However, I don't own
> this application and I don't have the source code. That is why I can only
> using firewall to handle it.
> If there is no software capable to handle this, I am thinking about writing
> a shell script to do it myself.

One way to do this would be to use "tcpforward", which is out there.
There forwards incoming TCP connections to a specified host/port.
Firewall your application so that it can receive connections only from
localhost.  Set up tcpforward to forward to your application's port on
127.0.0.1.  Then modify tcpforward to record the originating host of any
connection request, and check that any subsequence requests come from
the same host.

(Of course, whoever is trying to make the connections can set up
tcpforward on some host, and relay all their connection attempts through
it.)

Dale



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org