dport is not working on iptables command

6,024

You probably need to first identify the protocol, for example TCP or UDP. You do that by using the -p <protocol> option.

I'm assuming you want TCP, so your iptables command should look like this:

iptables -A INPUT -p tcp --dport 443 -j DROP
Share:
6,024

Related videos on Youtube

Mohammad Reza Rezwani
Author by

Mohammad Reza Rezwani

Msc of computer networks.

Updated on September 18, 2022

Comments

  • Mohammad Reza Rezwani
    Mohammad Reza Rezwani over 1 year

    In terminal I type :

    iptables -A INPUT --dport 443 -j DROP
    

    And it tells me :

    iptables v1.4.21: unknown option "--dport"
    

    what is wrong with --dport?