0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VyOSでNAPTとポートフォワーディングの設定

Posted at

VyOSをNAPTルータにするために行った設定方法とポートフォワーディングの設定方法を備忘録としてまとめます。

NAPTの設定

# set nat source rule 50000 outbound-interface eth0
# set nat source rule 50000 translation address masquerade

ポートフォワーディングの設定

  • destination portでは変換前のポートを指定する。
  • inbound-interfaceでは変換するときに入ってくるインターフェースを指定する。
  • protocolでは変換するデータの種類を指定する。
  • translationでは変換先アドレスとポートを指定する。
# set nat destination rule 60000 destination port 11111
# set nat destination rule 60000 inbound-interface eth0
# set nat destination rule 60000 protocol tcp
# set nat destination rule 60000 translation address 192.168.1.1
# set nat destination rule 60000 translation port 22

設定したコンフィグ

 nat {
     destination {
         rule 60000 {
             destination {
                 port 11111
             }
             inbound-interface eth0
             protocol tcp
             translation {
                 address 192.168.1.1
                 port 22
             }
         }
     }
     source {
         rule 50000 {
             outbound-interface eth0
             translation {
                 address masquerade
             }
         }
     }
 }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?