0

I have a basic confusion about how port forwarding works with DHCP assigned IP addresses.

If I set up port forwarding on a raspberry pi using its internal IP address and then set up dyndns so that the routers external IP address doesn't need to be known, if I unplug the pi for a while and reconnect it, will it be given a new IP with dhcp so that the port forwarding I just did no longer works?
If this is a problem can I set up port forwarding with a Mac address rather than device IP address?

3
  • 1
    You either need to statically define the IP address on the device, or you need to use DHCP reservations so that it is always assigned the same IP address. Unfortunately, questions about consumer-grade devices are explicitly off-topic here.
    – Ron Maupin
    Commented Oct 7, 2016 at 14:03
  • Thanks I guess I didn't need to specify a particular device, just needed that general info. I think I'll go with the dhcp reservation, but what is the nat masquerade thing the other guys answer spoke of?
    – Austin
    Commented Oct 7, 2016 at 14:14
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Commented Aug 15, 2017 at 4:27

1 Answer 1

1

This is a common case with dynamic IP address. Some equipment allow to create a NAT rule based on the interface rather than the IP address.

The way to configure this depends on the router. On linux based router this is commonly referred as masquerade or ip masquerade and the word masquerade is used in place of the IP address in the nat configuration.

Raspberry PI is off-topic on this Stack Exchange site, but if you need more info you may find answers on the Raspeberry PI Stack Exchange site

Not the answer you're looking for? Browse other questions tagged or ask your own question.