T
T
tehnazavr2018-07-13 14:52:27
iptables
tehnazavr, 2018-07-13 14:52:27

How to allow http access only for a specific ip in iptables?

It must be configured so that access to the server via http is only from one ip, and to all other ports from any ip addresses.
According to the instructions, I registered the rules for the desired ip in the INPUT and OUTPUT chains. I use the ACCEPT policy for all chains.
How to write a rule to restrict access to other ip via http?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pcdesign, 2018-07-13
@tehnazavr

iptables -I INPUT -p tcp -m tcp --dport 80 -j DROP
iptables -I INPUT -s 1.1.1.1/32 -p tcp -m tcp --dport 80 -j ACCEPT

1.1.1.1 is your ip that should have access.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question