V
V
Vladimir Revyakin2017-11-27 18:46:51
iptables
Vladimir Revyakin, 2017-11-27 18:46:51

Open access to port 80 for a specific IP address through Iptables?

Good evening, tell me the rule for iptables to open access to port 80 from a specific ip with a mask, for example 192.168.0.0/24

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
krosh, 2017-11-27
@jonimuesli

iptables -I INPUT -m tcp -p tcp --dport 80 -s 192.168.0.0/24  --comment "ALLOW LAN 80/tcp"  -j ACCEPT

But the /24 mask is not one, but 254 addresses. If you need one, then specify it, it will have a mask / 32 (it is possible without it in this case).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question