Knowee
Questions
Features
Study Tools

You need to configure a firewall rule that allows SSH access only from a specific IP address (192.168.1.100). What iptables rule(s) would you use?1.0 Marksiptables -A INPUT -p tcp --dport 22 -s 192.168.1.100 -j REJECTiptables -A INPUT -p tcp --dport 22 -s 192.168.1.100 -j ACCEPT

Question

You need to configure a firewall rule that allows SSH access only from a specific IP address (192.168.1.100). What iptables rule(s) would you use?1.0 Marksiptables -A INPUT -p tcp --dport 22 -s 192.168.1.100 -j REJECTiptables -A INPUT -p tcp --dport 22 -s 192.168.1.100 -j ACCEPT

🧐 Not the exact question you are looking for?Go ask a question

Solution

The correct iptables rule to allow SSH access only from a specific IP address (192.168.1.100) would be:

iptables -A INPUT -p tcp --dport 22 -s 192.168.1.100 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j DROP

Here's the step-by-step explanation:

  1. iptables -A INPUT -p tcp --dport 22 -s 192.168.1.100 -j ACCEPT: This rule appends (-A) a rule to the INPUT chain for incoming traffic. It specifies the protocol (-p) as TCP and the destination port (--dport) as 22, which is the default port for SSH. The source (-s) is set to the specific IP address 192.168.1.100. The rule's action (-j) is set to ACCEPT, which means it allows the traffic.

  2. iptables -A INPUT -p tcp --dport 22 -j DROP: This rule appends (-A) a rule to the INPUT chain for incoming traffic. It specifies the protocol (-p) as TCP and the destination port (--dport) as 22. The rule's action (-j) is set to DROP, which means it blocks the traffic. This rule effectively blocks all other SSH traffic not already allowed by the previous rule.

This problem has been solved

Similar Questions

Configure ufw so that it blocks all incoming traffic, except the following TCP ports:22 (SSH)443 (HTTPS SSL)80 (HTTP)

Let’s install the ufw firewall and setup a few rules on web-01.Requirements:The requirements below must be applied to web-01 (feel free to do it on lb-01 and web-02, but it won’t be checked)Configure ufw so that it blocks all incoming traffic, except the following TCP ports:22 (SSH)443 (HTTPS SSL)80 (HTTP)Share the ufw commands that you used in your answer file

Select the secure FTP protocol with the stated feature.Uses TCP port 990Requires two ports to be open on the firewallOnly requires a single port to be open on the firewallUses the SSH protocol to provide communication security

You need to configure a firewall to allow only secure HTTPS traffic (port 443) to a web server while blocking all other incoming connections. Which level of the TCP/IP protocol stack should the firewall operate at?1.0 MarksNetwork Access Layer (NAL)Internet Protocol (IP)Network Interface Card (NIC)Application LayerTransport Layer

Question 9Your organization uses a Linux-based network, and you’re configuring Uncomplicated Firewall (ufw). You want to disable file transfers that use the File Transfer Protocol (FTP), which occurs on port 21. Which command can you use to block all traffic on this port?1 pointsudoufw reload 21sudoufw delete 21sudoufw allow 21sudoufw deny 21

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.