Iptables - Open Port Only for one Server IP (allow connections from a specific range)
Posted
by
user1015314
on Server Fault
See other posts from Server Fault
or by user1015314
Published on 2012-03-21T11:19:26Z
Indexed on
2012/03/21
11:31 UTC
Read the original article
Hit count: 190
iptables
My server has multiple IPs,
1.1.1.1
1.1.1.2
and i have a service which listens to a port e.g. 88
Now i want,
when somebody from outside, wants to connect to the port, that he can only connect, to that port, if he connects to the ip 1.1.1.2:88 but if he tries to connect to 1.1.1.1:88 it should not react and it should look like that it dont exists and drops all connections.
Ok, than i need for 1.1.1.2:88 that only allows a specific ip range outside connecters.
for example only 9.*.*.*
can connect to that port and ip.
I'm using Centos. Thank you for your help.
© Server Fault or respective owner