オウムオペレーティングシステムはiptablesコマンドを受け入れません。

オウムオペレーティングシステムはiptablesコマンドを受け入れません。

私はという独自のチェーンを作りましたtest。すべてのパケットを指定されたポートのIPアドレスにドロップする新しいルールをチェーンに挿入したいと思います。

sudo iptables -I test -j DROP -d 130.x.y.z -dport 24 

24parrot OS VMは、上記のコマンドのパラメータがわからないことを知らせます。 2時間くらい頑張ったけどまだ進展がないですね。

-I inserts a rule
-j specifies the action to the packet in the rule
-d specifies the destination which should be an IP address and not a name
-dport should be the port # for which this firewall rule should act 

--destination私は次のような多くのバリエーションを試しました。--destination-port

どのように動作するのかわかりません。

ベストアンサー1

問題は構文が正しくないことです。以下を試してください。

すべてのトラフィックをブロックする

iptables -I test -j DROP -d 130.x.y.z -p all

SSH(22)などの特定のポートをブロックします。

iptables -I test -j DROP -d 130.x.y.z -p tcp --dport 22

ここで、-pはプロトコルtcpまたはudp、--dportは宛先ポートです。

おすすめ記事