2
votes

Alright so I have a few questions, I have a D - link 2650u router in my house let's start with that

now I wrote a TCP server in Python that binds itself to my private IP address and to port 5000, ( My private IP address is 10.0.0.4), For example let's say my public IP address is 76.123.24.21. Now, my TCP server works fine within the LAN and within the private IP addresses, However if I want other people to be able to send packets to me and my server to receive them from outside the LAN I need to open port 5000 and forward it, e.g, enter to my router's NAT port forwarding table and define that all packets received on port 5000 would be forwarded to my private ip address which is 10.0.0.4. So my first question is this, If I forward port 5000 to 10.0.04 this means that every packet sent to 76.123.24.21:5000 would be received in my TCP server that is binded on port 5000, correct? ( Of course if the packet is sent from a TCP socket )

Now my second question is, How do I forward ports on my router..... I have a D - link DSL 2650u router, and whenever I login to it's webpage, and connect with the correct username and password, All the options it shows me are:

Device Info
Diagnostics
Management

and nothing regarding advanced settings or NAT to forward ports......

Please help me with this!

2

2 Answers

1
votes
  1. Yea. Your are right. Every packet with TCP destination port equals to 5000 will be forwarded to 10.0.0.4 . Inside port number and outside port number could be the same or difference, router doesn't care.

  2. Port Forwarding is known as "Virtual Server" in D-Link literature. You can configure port forwarding under "Advanced Setup" in "NAT - Virtual Servers".

Any client PC in the DMZ will be exposed to various types of security risks. So if your application just uses a port, only use port forwarding.

0
votes

Since TCP server in behind a NAT device, which means TCP client outside a NAT device need to initialize a socket connection. I suggest you open a DMZ host in your router but a port forwarding.

It should be in the management. Look for DMZ settings.