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.

nat超え

Posted at

yamahaルーターのnat超えに関する記事

ネットワーク構成
RTX_WWW(Webサーバー) --- RTX_WR --- NVR_NET --- PC
  • PCからはRTX_WRのグローバルアドレスにポート80番でアクセスする
  • RTX_WRはポート80番にアクセスしてきたパケットをnatを使ってプライベートアドレス宛に送る
  • ip filterを用いて接続する通信を記述する(ip filterなしだったらALL PASS,あったらホワイトリスト)
  • dynamic filterの基本的な使用方法は内側→外側の通信のレスポンスを受け入れられるように設定する
  • 動的フィルターはセッションが切れたときにlogを出す
  • フィルターのsyslogレベルは notice(設定必要)

習得コマンド

  • show ip connection *detail
  • show nat descripter address *detail
  • syslog notice on

RTX_WWW

  • IP_アドレス(WAN) : 122.176.74.4/24
(config)
login user admin *
user attribute admin administrator=2 login-timer=clear
console character ja.utf8
console prompt RTX_WWW
login timer clear
ip route default gateway 122.176.74.1
ip lan2 address 122.176.74.4/24
tftp host any
telnetd host lan
httpd host any

RTX_WR

  • IPアドレス(LAN) : 122.176.74.1/24
  • IPアドレス(WAN) : 10.130.1.2/24
login user admin *
user attribute admin administrator=2 login-timer=clear
console character ja.utf8
console prompt RTX_WR
ip route default gateway 10.130.1.1
ip lan1 address 122.176.74.1/24
ip lan2 address 10.130.1.2/24
ip lan2 secure filter in dynamic 1
ip lan2 secure filter out 1300
ip lan2 nat descriptor 1
ip filter 1200 pass-log * 122.176.74.4 tcp * www★
ip filter 1300 reject 122.176.74.4 * tcp www *
ip filter dynamic 1 * * www
nat descriptor type 1 masquerade★ポートのマスカレードを使用
nat descriptor address outer 1 primary★外側への通信のwanに対しては(今回は10.130.1.2)NATを使用
nat descriptor masquerade static 1 1 122.176.74.4 tcp www ★10.130.1.2:80は122.176.74.4に変換
syslog notice on
telnetd host lan

NVR_NET

  • IPアドレス(LAN) : 192.168.100.1/24
  • IPアドレス(WAN) : 10.130.1.1/24
(config)
console character ja.utf8
console prompt NVR_NET
login timer clear
//不要ip route default gateway 10.130.1.2(インターネットはデフォルトゲートウェイでRTX_WRを知らない)
ip lan1 address 192.168.100.1/24
ip lan2 address 10.130.1.1/24
telnetd host lan
dhcp service server
dhcp server rfc2131 compliant on
dhcp scope 1 192.168.100.2-192.168.100.191/24

PC

  • IPアドレス : 192.168.100.2/24(dhcp)
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?