You have at least 3 options here:
1. The cable is hooked in the Ethernet port of your modem and to the WAN port of your router.
Is this your case?
You need to keep this in mind:
on your modem you have to forward the traffic incoming on the listen port, towards the IP address of your router’s WAN interface.
on your router you have to forward the traffic incoming on the listen port from the WAN interface, towards the IP address of your PC.
You need to understand that in this case you have 2 LANs here (2 different collision domains). One is made up of your modem’s Ethernet interface and your router’s WAN interface.
The second one is made up of all the Ethernet ports of your router and the wireless switch. There is NAT being performed between these 2 networks even if they may be using the same base network address (i.e. 192.168.1.0).
The first LAN is regarded as a “WAN” by your router.
If that’s your setup, then on the NAT page of your modem you need to input the IP address of the WAN interface of your router (the address which you bind on the modem NAT page, to the port you forwarded), not the IP address assigned to your computer by the D-Link router (as you say you did).
That way all traffic incoming on that/those port(s) will be forwarded to your router WAN interface. From there it’s taken by your router which will forward it to your IP address.
The issue is that, at present time, the WAN interface of your router, most probably, **gets an IP assigned dynamically **by DHCP from your modem. That means that the IP of your router’s WAN interface can change (when its lease expires or one of the devices gets unplugged or in case of power shortage, etc.). That will screw the NAT performed by your modem.
You will need to either access the the web interface of your router and set a static IP for the WAN interface, from the same network range your **modem **uses (if that’s possible) or to try and set in the modem web interface so that your router’s WAN interface always gets the same IP assigned from the modem (if that’s possible). Then check what is the WAN address of your router and input it on the NAT page.
If setting a static IP for the WAN interface isn’t possible neither on the router side or on the modem side, then this won’t work because your modem needs a fixed address (for the WAN interface address set on the NAT page) to forward the incoming traffic on the listen port to. (Well, it will work but only until the IP of your WAN changes.)
2. Another simpler solution would be to put your modem in bridge mode (if that’s available through the web interface or CLI commands). This way it would act as a simple modem (NAT/routing disabled) and you won’t need to perform port forwarding on the modem anymore.
- You could also try to bypass the router part of your D-Link router by connecting the cable coming from the modem to a LAN port of the router instead of the WAN port and thus use it as a simple switch. You will need to disable the DHCP server on your router in this case and let all devices get IP addresses from the modem instead. This way you would have a single LAN (subnetwork) and perform port forwarding only on your modem.
I wish there were more specific instructions but it all depends on what the web interfaces of both devices allow you to do or not.