How to block an IP address to connect my webserver

0 votes

Hi Guys,

I have my HTTPd webserver. I want to block one IP address to connect my webserver. How can I do that?

Jun 10, 2020 in Linux Administration by akhtar
• 38,260 points
759 views

1 answer to this question.

0 votes

Hi@akhtar,

You can block one IP address using iptables. Use the below-given command.

$ iptables -A INPUT -s 10.0.0.124 -p tcp --destination-port 80 -j DROP
$ iptables-save > /etc/sysconfig/iptables

Generally, httpd web server works on port 80. So in your command pass your webserver port.

answered Jun 10, 2020 by MD
• 95,460 points

Related Questions In Linux Administration

0 votes
2 answers

How to change IP address of an Ubuntu VM?

The easiest method is through network manager: 1- ...READ MORE

answered Aug 25, 2020 in Linux Administration by Pistle
• 300 points
14,502 views
0 votes
1 answer

How to Unblock SSH and FTP Access to Specific IP in Linux?

Firewalls(most of them) can either Reject or ...READ MORE

answered Jul 16, 2019 in Linux Administration by Archana
• 5,640 points
15,323 views
0 votes
1 answer

How to limit upload size in Apache Webserver?

Hi@akhtar, You can make use of the LimitRequestBody directive to ...READ MORE

answered Jun 8, 2020 in Linux Administration by MD
• 95,460 points
4,107 views
0 votes
1 answer

How to unblock one IP from black list?

Hi@akhtar, To unblock your blacklisted IP address, you ...READ MORE

answered Jun 10, 2020 in Linux Administration by MD
• 95,460 points
749 views
0 votes
1 answer
0 votes
1 answer

How do I set variable if a specific package version is installed in CFEngine?

Here is what you can do.Just use packagesmatching to ...READ MORE

answered Jul 12, 2018 in Other DevOps Questions by Atul
• 10,240 points
1,180 views
+6 votes
17 answers

What are job opportunities as a Linux System Administrator?

I just started working professionally as a ...READ MORE

answered Jul 19, 2018 in Career Counselling by eatcodesleeprepeat
• 4,710 points
11,331 views
0 votes
1 answer

setting a variable output from a bash command

You can use $(command), which in my ...READ MORE

answered Feb 15, 2019 in Linux Administration by DareDev
• 6,890 points
2,519 views
0 votes
1 answer

How to create one new partition in my hard disk in Linux?

Hi@akhtar, To create new partition you can follow ...READ MORE

answered Apr 7, 2020 in Linux Administration by MD
• 95,460 points
1,182 views
0 votes
1 answer

How to change port no 80 of httpd webserver?

Hi@akhtar, You can change port no of httpd ...READ MORE

answered Apr 21, 2020 in Linux Administration by MD
• 95,460 points
2,391 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP