Hello,
When setting up port forwarding, the external port is the port you configure on your router to receive incoming connection requests from the internet and forward them to your internal network’s target device (your file-sharing server). The internal ports are the ports used by the file-sharing service (such as 135-445).
1. Determine Internal Ports
You already know that the internal ports are 135-445, which are used for Windows File Sharing (SMB). If you're only using SMB for file sharing, the most commonly used port is 445.
2. Choose an External Port
The external port is the port used to access the internal service via the public IP address. You can choose an uncommon high port number to avoid conflicts with other services. A typical range for external ports is from 1024 to 65535.
For example, you can choose 50000 as the external port.
3. Configure Port Forwarding
- External Port: Choose an unused high port number (e.g., 50000).
- Internal Port: Set this to 445, the port for SMB file sharing.
- Protocol: Select TCP (file sharing generally uses TCP).
- Target IP: The internal IP address of your file-sharing server (e.g., 192.168.x.x).
4. Security Considerations
Exposing these ports (especially SMB ports) to the internet may pose security risks, as SMB has known vulnerabilities. For safer file sharing, it is recommended to use a VPN (Virtual Private Network) or a more secure file transfer protocol (such as SFTP) to avoid directly exposing SMB services to the public internet.
Summary:
- The internal ports are 135-445 (typically use 445).
- The external port can be a high port number, such as 50000.
- Be sure to understand the security risks, especially when exposing SMB services to the public internet.
If you have any further questions or need additional assistance, feel free to ask!