Curious ipaddress result

Where does Panorama obtain the IP address? ipaddress is coming up with a result that I can’t explain.

Everywhere I look, the IP of the computer is listed as 192.168.86.248. I can find nothing on my network that starts with 169 so I have no idea where this is coming from. Testing the same simple procedure on other computers gets the 192… IP that I expect.

I don’t know that I need an answer beyond curiosity at this point since this unexpected IP address does what I need it to do.

A 169.xxx.xxx.xxx is a self assigned IP address that a network interface will auto create when it can not successfully acquire an address during a DHCP request.

This kind of self assignment is what allows multiple computers all connected via a switch or hub to then automaticaly communicate with each other without the need for a router.

Well, I’ve learned something. Thanks.

Based on your reply I researched it a bit and supposedly the computer is cut off from any internet connection if it has a 169. But it isn’t; I’m using it right now. And the OS claims it has the expected 198 IP address as my screen shot illustrated.

A restart loads the same 198 IP address according to the OS. But Panorama shows it with a new 169. ??

So I remain puzzled but a bit more enlightened.

You can view the source of the ipaddress command and see for yourself … though that just moves the mystery down a level.

Since you didn’t specify external zone, this command uses the shell command

ifconfig -u

to find this information. This puts out a lot of information, which the following code parses to extract just the IP address.

Why does this process come up with the particular value you see? I don’t know. On my system, the raw ifconfig output contains over 100 lines, with this in the middle:

On my computer right now this command returns 192.168.1.179, which agrees with what the network panel in System Preferences shows.

With the shell command I get:

inet 192.168.86.248 netmask 0xffffff00 broadcast 192.168.86.255

I ran OSX Cocktail, and restarted in Safe Mode but Panorama continues to return a 169 IP address even as everything else on the computer seems to see the 192.

I tried adding a parameter of “internal” to ipaddress but no change.

Then I checked what Panorama is getting in ifconfig and it matches the shell result.

:open_mouth: Ah, but now, looking carefully at ifconfig’s contents, en0: contains the 169 address while en1 contains the 192.
Screenshot 2023-01-27 at 6.04.40 PM

Looking at the shell results again, it shows both as well.

The surrounding code is meaningless to me at present and I have no idea why both IPs are in there but they are.

Recognize that every ethernet network interface will obtain a unique IP address. ie. In System Settings/Network, You will probably have multiple interaces that are active. One may be Wi-Fi, another Ethernet, another Firewall, etc. Click on each one as see what its IP address is. en0 is a different interface than en1

Apparently Panorama is grabbing one of your other network interfaces that is not connected to any router, while you are actually using the one with the Green bullet. Most always, only one will have the Green bullet but there will be other ‘optional’ interfaces ready to be used and one of those has that 169.xxx.xxx.xxx address.

A USB thumb drive adapter that allows for an Ethernet Cat-5 connection will have its own IP address (or 169 number.)

Quoting the late David Crosby, “I would like to be learning something new, and growing, the day that I die.”

I was going to ask you for exactly the information you provided. You apparently have two active network interfaces on your computer, perhaps WiFi and Ethernet? The ipaddress statement has no way to handle multiple active network interfaces, so it just picks the first one it finds.

169 refers to your local network (i.e. “intra” network). 192 refers to your outside network (i.e. “inter” network or World Wide Web). In theory as long as two or more computers can see each other on a local network, Panorama server should work fine (and yes I’m ignoring the fact that Panorama needs access to the internet for billing purposes etc.). Normally all of this is done automatically and we never have to worry about it. Apple takes care of this for us through the network tool. The only time I have ever messed with this is when I have configured a “webcam” to work on a local network only.

I do have a large format printer connected via an ethernet cable. I found it listed in the System Info with a 169 IP address. So this is the reason I have a 169 showing up in the ifconfig data.

Now that I’m aware of it I can probably write a custom function to replace ipaddress. Basically it would be the same as the one in Panama now, but would either allow me to choose from multiple results, or would eliminate any 169’s automatically.

There are inaccuracies here.

A 169 is not ‘your’ local network. It is a self assigned IP address when a device set to acquire a DHCP address can not communicate with a DHCP server. Technically it is an APIPA address (Automatic IP Addressing.) It would only be a local network as it can not be routed over the internet.

A 192. does not refer to an ‘outside network’ but in fact refers to a local network as it too can not be routed over the inter(net). A 192.168.xxx.xxx (or a 172.16.x.x → 172.31.255.255, or a 10.0.0.0 → 10.255.255.255) are all local addresses as they are created by a local router.
That router may or may not act as a gateway to the internet which would then allow those IP addresses to access the www but not necessarily so.

If the ‘large format printer’ is never wanted to be accessed via the internet, that might be a reason to leave it as a 169. address. But if there are other computers on your network that might also want to access the printer, then they too would have to have a 2nd ethernet interface specifically for the 169. network that the printer and your computer are presently communicating on.

More typically, an admin would set the ‘large format printer’ to DHCP and allow it to acquire a 192. address so that a single interface on your computer could communicate with both the printer and the www with a single network connection. That would then allow other computers on the network to also access the printer. There is no ‘custom function’ necessary to replace the 169 address. Just set it to DHCP and you’ll be good to go.

Connected to a router or to a specific computer? Sounds like the latter. That is a very unusual network topography. Usually you would connect all devices to the router. Then a) any computer on your network should be able to access the printer, and b) you wouldn’t have this weird double IP situation. Essentially right now you are using your computer as a second router (which is possible, after all routers are computers that are just running a routing application).

I’m curious, why do you care what the IP address is anyway? Sounds like you have an actual application where you need that number, which isn’t something I’ve ever needed.

There’s nothing unusual in it. Using a large format Epson printer that connects only via Ethernet it’s a fairly typical arrangement to connect it to the computer doing photo processing. Especially if the router is nowhere in the immediate vicinity.

As for needing the IP address, on a server computer, the only way I’ve found to have Panorama Server perform tasks with the data on the server is via its web interface. One example is for a timer in Panorama to tell Pan Server to export a set of text files that Panorama will import into single user files in order to compile and email PDF reports from the day’s activities.

The IP address could be hardcoded but if it changes or if the software is loaded to another server, it’s convenient to have it readily determined.

The triggering process for the above for instance is running on my server now as I develop it for a client. They may have a new server or use the same as is running Pan 6 Server now. I’d rather not have it depend on a hard coded IP address to work in any of these three possible scenarios. The ability to accurately detect its own IP address is quite convenient.

There’s nothing wrong with it, but it is an unusual network configuration.

I’m glad I asked. I think the function you are looking for is panoramaxserverurl(, it will return the URL of any server that your computer is configured to connect to. It’s guaranteed to be correct because that’s how Panorama itself knows how to connect.

You might also find this useful if you know you are running on the same computer as the server.

So you can use

panoramaxserverurl(localpanoramaxservername())

to find out the ip address of the server running on the same computer.

I had actually tried that previously per your suggestion in another thread on retrieving the IP address.

panoramaxserverurl(localpanoramaxservername())
returns
http://myserver.local.:8080

So it requires some parsing and configuration as another domain for a site in the Web Server software.

So at this point I’m going to stick to pursuit of the server’s IP address.

Did you try that for passing back commands? It looks “funny”, but I believe it should work as-is, no parsing or rearranging needed. Just add the rest of the url path you need. You can use that with url(, loadurl(, etc, or even in Safari. (Of course that URL will only work on this particular computer, don’t save that string and pass it to other computers.)

Of course since. you know it is the same computer you can also use

http://localhost:8080

(or whatever port you are using)