1. 限制局域网内每个用户的连接数为50
iptables -I FORWARD -p tcp -m connlimit –connlimit-above 50 -j REJECT
2. 限制指定局域网用户192.168.1.100的连接数为50
iptables -I FORWARD -p tcp -s 192.168.1.100 -m connlimit –connlimit-above 50 -j REJECT
这里举个例子,比如要限制192.168.1.2这个用户的连接数为50
iptables -I FORWARD -p tcp -s 192.168.1.2 -m connlimit –connlimit-above 50 -j REJECT
3. 限制除用户192.168.1.100以外的IP连接数为50
iptables -I FORWARD -p tcp -s !192.168.1.100 -m connlimit –connlimit-above 50 -j REJECT
这里也举个例子,比如要除了不限制192.168.1.2外,限制其它所有用户的连接数为50
iptables -I FORWARD -p tcp -s !192.168.1.2 -m connlimit –connlimit-above 50 -j REJECT