Sysnet Board คู่มือ การใช้งานอุปกรณ์ Network

การ Config อุปกรณ์ เครือข่าย Network Device => iBSG : The Wi-Fi Hotspot Gateway with Cloud Management System => หัวข้อที่ตั้งโดย: yod เมื่อ วันที่ 12 กรกฎาคม 2017, 17:46:52

ชื่อ: การทำ Port Forward แบบ Behind NAT หรือ Router ซ้อน Router
โดย: yod เมื่อ วันที่ 12 กรกฎาคม 2017, 17:46:52

การทำ Port Forward แบบ Behind NAT หรือ Router ซ้อน Router


Router ซ้อน Router หรือ NAT ซ้อน NAT ผมใช้คำงงไปหน่อย ดูตามรูปเลยครับ จะประมาณว่าอุปกรณ์ Router B ต่อหลัง Router A อีกที และ ต้องการทำ Port Forward ไปยัง กล้อง IP, NVR, DVR หรือพวก Web Server ที่ต่อหลัง Router B ครับ ซึ่งถ้าเข้าใจ Concept จะสามารถใช้ได้กับทุก Router เลย


แต่ IP ที่ขา WAN ของ Router A ต้องเป็น IP Public นะครับ และ ตัว Load Balance ต้องทำ Routing Policy ดีๆนะครับ ถ้า PepLink หรือ Draytek สามารถจะระบุ Session ให้ออก Wan ที่ต้องการได้เลยแบบง่ายๆ


(https://www.sysnetcenter.com/board/images/ibsg/forward-port-behind-nat/ibsg-port-forward-behind-nat-000.jpg)


ในตัวอย่าง ทำ Port Forward ไปยัง Unifi Software Controller ซึ่งเปรียบเสมือน Web server ตัวนึง ซึ่งสามารถจะดัดแปลงใช้กับพวก NVR โดยการเปลี่ยนแค่หมายเลข IP Address และ หมายเลข Port ให้ตรงกับอุปกรณ์ครับ


อุปกรณ์ที่ใช้ทดสอบ PepLink Balance One (https://www.sysnetcenter.com/peplink-pepwave/1454-peplink-balance-one-loadbalance-dual-wan-vpn-router-accesspoint.html) เชื่อมต่อกับ Internet , IBSG Server (https://www.sysnetcenter.com/hotspot-billing-internet-/82-ibsg3-internet-billing-log-recorder-solution.html) และ Unifi Server Controller (https://www.sysnetcenter.com/132-ubiquiti-unifi-ap)


1. ในส่วนของ Unifi Server Controller จะใช้ Port 8443 และ หมายเลข IP Address คือ 192.168.2.140

(https://www.sysnetcenter.com/board/images/ibsg/forward-port-behind-nat/ibsg-port-forward-behind-nat-002.gif)


IP Wan ของ iBSG จะเป็น 192.168.1.153 ที่ผมใช้ตั้งเป็นแบบ DHCP ถ้าใช้งานจริง ควรตั้งเป็น Static IP ไว้ครับ

(https://www.sysnetcenter.com/board/images/ibsg/forward-port-behind-nat/ibsg-port-forward-behind-nat-005.gif)


2. Config Port Forward ที่อุปกรณ์ PepLink

Menu Network --> Inbound Access --> Port Forwarding

Click [Add Service]
Service Name: ตั้งชื่อ Service
IP Protcol: เลือก TCP/IP
Port: Single Port กำหนด Service Port ที่จะ Forward ผ่านไปยัง iBSG (9000)
Connection: WAN1
Server IP Address: IP ขา Wan ของ iBSG (192.168.1.153)

(https://www.sysnetcenter.com/board/images/ibsg/forward-port-behind-nat/ibsg-port-forward-behind-nat-006.gif)


Click [Save] และ [Apply]


เสร็จเรียบร้อยสำหรับการ Forward Port จาก PepLink ไปยัง iBSG


3. Login เข้า iBSG

Menu --> Network --> Port Forwarding

Click [Add]

Protocol: TCP/UDP
Ext Port: หมายเลข Port ที่เข้ามายัง iBSG (Port ที่เข้ามาทาง WAN ตัวอย่างคือ 9000)
Int Port: หมายเลข Port ที่จะ Forward ต่อไปยัง Unifi Server (8443)
Int Address: IP Address ของเครื่อง Unifi Server (192.168.2.140)
Passthrough: ถ้า Click ตรงนี้ เครื่องที่ Forward Port จะออก Internet ได้เลย

(https://www.sysnetcenter.com/board/images/ibsg/forward-port-behind-nat/ibsg-port-forward-behind-nat-008.gif)


Click [Add] และ [Apply]


ฝั่ง iBSG มีแค่นี้ครับ


ทดสอบ


พิมพ์ https://sysnet.dyndns.org:9000 ผ่านเครือข่าย 4G ต้องเข้าหน้า Manage Software Unifi Controller ได้ อ้อ..ที่ต้องมี https เพราะ Software Unifi Controller ใช้ SSL ครับ ถ้าเป็นพวก NVR ก็ใช้ http เฉยๆครับ


(https://www.sysnetcenter.com/board/images/ibsg/forward-port-behind-nat/ibsg-port-forward-behind-nat-009.gif)


เรียบร้อยครับ  :D :D :D



ชื่อ: Re: การทำ Port Forward แบบ Behind NAT หรือ Router ซ้อน Router
โดย: leondevil เมื่อ วันที่ 26 มีนาคม 2019, 16:18:58
สวัสดีค่ะ รบกวนสอบถามค่ะ

คือต้องการที่จะ forward port ออกไปให้เป็น HTTPS ทั้งหมด สามารถทำได้มั้ยคะ

ตอนนี้มีอุปกรณ์ Raspberri pi ทำเป็น CCTV อยู่หลายตัว ที่ port 8081, 8082, 808...

ขณะนี้ใช้ no-ip forward port ออกไป แต่ว่ามันเป็น HTTP ธรรมดาค่ะ

เห็นในตัวอย่างนี้ port ที่ forward ออกไป สามารถทำเป็น HTTPS ได้ (https://sysnet.dyndns.org:9000)

ถ้าต้องการทำแบบนี้บ้าง ต้องใช้อุปกรณ์ตัวไหนบ้างคะ รบกวนแนะนำด้วยค่ะ

ขอบคุณมากค่ะ

Users found this pages searching for: