audi30tdi 0 Posted August 6, 2022 Hello! Is it possible to check and fine what ip I got on the wan side?? And how can I set the printers ipaddress?? Have dhcp on my ISP, and as I use a redirect on my printer from my office, I had to change the ipadr the printer should use very often. I hope I could make a program that read my wan adr, and could set this ip to the printer automatically! Regards Kåre! Share this post Link to post
FPiette 382 Posted August 6, 2022 You should better explain the PC connection to the ISP and the printer connection to the ISP. Usually, there is a router and that device know the external (public) IP address. I don't think there is a generic API that works with all routers. There are external server that show your external (public) IP on a web page the return to you. For example try this: https://www.whatismyip.com/ If they don't provide an API, you can always use a HTTP component to get the page at that URL and parse the returned HTML to extract your IP address. Share this post Link to post
audi30tdi 0 Posted August 7, 2022 I know, but the ISP is only provided DHCP for my kind og connection, so therefor I was looking for a Delphi code/information to make my own program to get my wan address and set that to my printer settings in windows. So if that program is just checking every day, it will work just as I have static IP Share this post Link to post
Angus Robertson 574 Posted August 7, 2022 So what did you see in your browser when you viewed https://www.whatismyip.com/ ? Exactly what you are asking for? That particular site might just disappear, so long term it would be better to use a STUN client widely used for VoIP. Angus Share this post Link to post
Hans J. Ellingsgaard 21 Posted August 7, 2022 You can usa an API like https://www.ipify.org to get your public ipaddress. When that is said, this sound strange. Do you have a printer that can be called directly with a public ipaddress, do you not have a vpn or some other secure connection to the office network? Share this post Link to post
Remy Lebeau 1392 Posted August 8, 2022 On 8/7/2022 at 4:45 AM, audi30tdi said: I know, but the ISP is only provided DHCP for my kind og connection, so therefor I was looking for a Delphi code/information to make my own program to get my wan address and set that to my printer settings in windows. So if that program is just checking every day, it will work just as I have static IP You can't assign a WAN IP to a printer on the LAN side. If you are trying to access your LAN printer over the public Internet, you will have to setup port forwarding on your router to route incoming connections from a WAN IP/Port to the printer's LAN IP/Port. Then, as others have mentioned, there are plenty of external services you can query to get your current WAN IP. Otherwise, a better option is to just create a VPN into your LAN network, and then use the printer's LAN IP. Share this post Link to post