1

I have a device (an IP phone) that only allows an explicit IP address to contact the remote server. However, the IP address of the remote server can change (it's dynamically assigned).

I figure there must be a way to connect the IP phone to an inexpensive router that would be able to do this mapping but I have no idea how I might go about this because (as far as I know) the rules you specify in a router also use hardcoded IP addresses.

Anyone know how to do this? Guidance would be very much appreciated.

10
  • 2
    In general, you use names to resolve IPs at run-time, but not really the reverse, so most network client libraries will not attempt a lookup of any kind if they are provided the IP. To change that behavior you would need access to the code, to perform a reverse lookup on the ip to get the name, and a forward lookup to get the ip DNS associates with the name. that way you could use a host file to resolve the reverse lookup to get the name and then use it for forward resolution. but then again, you would be able to change the hardcoded IP if you had access to source and the compilation tools. Commented Jul 1, 2015 at 23:25
  • And if pigs had wings they could fly! I understand one normally converts names to IP addresses, but my situation is exactly as I describe and I'm not in a position to get at the firmware in the IP Phone.
    – David
    Commented Jul 2, 2015 at 3:27
  • shouldn't just editing the hosts file (works on Linux and Windows) help: IP.OF.PH.ON.EX Alternative.Hostname
    – ljrk
    Commented Jul 2, 2015 at 5:58
  • @David, I've been misunderstanding what you meant by "Hardcoded" or "explicit" IP. Thats good though, because in that case, I can think of a few ways to pull it off, but neither will be simple and both will cost at least some money (DDNS providers are reasonably cheap). Still its better than if the programmer had written it to use 239.44.55.66 and it could not be changed. Commented Jul 2, 2015 at 7:21
  • 1
    @David, 239.44.55/24 is a Multi-cast group address and is handled differently than host addresses. My computers in the 192.168.xx.0/24 space often communicate with Multicast by crafting packets in the 239.x.y.z space, and the multicast group is overlayed on the actual 192.168.xx.0/24 network. That may be why you are having trouble with the router option. en.wikipedia.org/wiki/IP_multicast Commented Jul 3, 2015 at 8:31

2 Answers 2

1

Ahh, I understand, you can only use dotted-decimal format for the PBX address.

Usually, in the programming world, a "hardcoded IP" is a specific address written directly into the code, and cannot be changed at all. Sorry for the confusion.

In this case that does open up some options, including a VPN or a VPS running a Reverse Proxy, in combination with a Dynamic DNS provider (and a router that supports it). you may not need to travel with a router at all.


Provided your phone supports a VPN client, you can establish a VPN connection to a DDNS name that points to your home network. that will connect your phone to your LAN as though you were directly plugged into it. you can then access the PBX server by its private address on your LAN. If your phone does not support a native VPN client, you could use a cheap router at your location to create a site-to-site VPN link to home on the phones behalf.

so consider this scenario:

home public IP: 1.2.3.4
DDNS name: pbx.mynet.net --> 1.2.3.4
PBX IP: 10.0.1.1

you would set up a VPN on your router, and connect the phones VPN client to 'pbx.mynet.net', and in your IP phones PBX server address you would set 10.0.1.1.

|phone| >10.0.0.1>  {|VPN| >pbx.mynet.net=1.2.3.4> |router|} >10.0.1.1> |PBX|

Another option would be a VPS, with a public IP. you would set up a reverse proxy to redirect traffic on port x to your DDNS name.

LAN public IP: 1.2.3.4
VPS IP: 4.3.2.1
DDNSName: pbx.mynet.net --> 1.2.3.4
proxy redirect:  :1234 --> pbx.mynet.net:1234
PBX LAN address: 10.0.1.1

You would point your phones PBX server address to 4.3.2.1. when the VPS receives the packets, it will forward them to 1.2.3.4, and your port forward rules will forward the packets on to the PBX server.

|phone| >4.3.2.1>  |VPS| >pbx.mynet.net=1.2.3.4>  |Router NAT| >10.0.1.1> |PBX|
3
  • It doesn't support VPN. i have already experimented with site-to-site VPN and have that working. But I want a solution where I can just carry the phone and router somewhere, plug them in to a hotel wifi (say) and have its IP address mapped dynamically. So far the only thing I can think of (just based on initial reading) is a ddwrt-based router win an ip table rule that can be updated dynamically. But how would I actually do this?
    – David
    Commented Jul 2, 2015 at 12:34
  • why can't you do site-to-site VPN between your on-the-go router and your home router? The VPS option is also viable, and doesn't require you carry the router, but does incur an additional monthly cost. Commented Jul 3, 2015 at 8:23
  • I've done site to site VPN and hat works fine. However not everyone who will need this device will be in a position to do this. So I'd really like to understand how I could do it by directly mapping one ip to another. To be honest, I'm rather surprised that this is seemingly so difficult to do (based on not getting any answers). I would have thought this to be an easy problem for anyone who understands networking deeply.
    – David
    Commented Jul 3, 2015 at 13:48
-1

I believe this could be achieved by using SNAT, ie. source-NAT, by giving one router-port (virtual or not) IP-address 10.0.1.1 and setting SNAT on it to your public IP-address. OpenWRT does have a clean, browser-based UI for doing all this and you can read about the settings and such on their website at https://openwrt.org/docs/guide-user/firewall/firewall_configuration

Disclaimer: I have never used a SNAT myself and can't offer much more than this.

1
  • I worked with NAT much and can confirm this has nothing to do with SNAT. Commented Nov 14, 2021 at 7:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .