Answer the question
In order to leave comments, you need to log in
Iptables: how to allow connections for specific ports with ip only via chain?
There are host1 and host 2, connections of ports 27010:27100 are created between them. It is necessary to forbid connecting on these ports to everyone except host 1 and host2.
My default policy is to allow everything that is not prohibited. Here is how I tried to implement:
Chain mongo (2 references)
target prot opt source destination
ACCEPT all -- host1 anywhere
ACCEPT all -- host2 anywhere
ACCEPT all -- anywhere anywhere source IP range 172.17.0.0-172.17.255.255
DROP all -- anywhere anywhere
Chain INPUT (policy ACCEPT)
target prot opt source destination
mongo tcp -- anywhere anywhere tcp dpts:27010:27100
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:bootps
ACCEPT udp -- anywhere anywhere udp dpt:bootps
mongo tcp -- anywhere anywhere tcp dpts:27010:27100
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question