Translated message

A translation of this page exists in English.

iptables NAT を使用したポートの出力先変更が機能しない時があります

Solution Unverified - Updated -

Issue

以下のように、iptables ルールを使用してポートの出力先を変更することができます。

iptables -t nat -A PREROUTING -i bond0 --dst x.x.x.x -p tcp --dport 1234 -j REDIRECT --to-port 4321
iptables -t nat -A PREROUTING -i bond1 --dst y.y.y.y -p tcp --dport 1234 -j REDIRECT --to-port 4321

ただし、しばらくすると、これらのルールが機能しなくなるようです。

以下のコマンドを使用して iptables ルールで使用しているポートが開いているかどうかを確認すると、NAT ルールが再度機能します。

nmap -sX x.x.x.x 

Environment

  • Red Hat Enterprise Linux Server リリース 5、6
  • iptables

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content