Boston Linux & UNIX was originally founded in 1994 as part of The Boston Computer Society. We meet on the third Wednesday of each month at the Massachusetts Institute of Technology, in Building E51.

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



Hi, All,

I am running a service in Ubuntu on a port. I try to limit the number of ip
addresses which can connect to the port. For example, if the limit is set
to 1, only connect from on ip address is allowed.
If there is a connection from another ip address, it will be declined.

The only thing I can find so far is:
iptables -I INPUT -p tcp --dport 8000 -m connlimit --connlimit-upto 200
--connlimit-mask 0 -j ACCEPT

However, this only limits the number of connections instead of the number
of ip addresses.
Any one knows how to do it?


Thanks a lot!

Tom



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