I need to get the dynamic IP address of the ppp0 interface
(point-to-point) under Linux. I cannot do a reverse DNS
lookup since the associated name is dynamic too (something like
user-bla-bla-IP-.someisp.com), and I would prefer to avoid parsing /sbin/ifconfig since
a) I don’t know how reliable it would be (and it’s ugly anyway)
b) I cannot get sample output to work on since I have no access to the
remote machine (I was planning on somebody installing my script that)
[Context: I’m binding a socket to that interface and sending the IP and
port info w/ UDP to another computer (server) behind a firewall that then
connects to the client. This is all required because of quite draconian
firewalling rules (my machine is behind THREE different firewalls,
ouch!)]
I need to get the dynamic IP address of the ppp0 interface
(point-to-point) under Linux. I cannot do a reverse DNS
lookup since the associated name is dynamic too (something like
user-bla-bla-IP-.someisp.com), and I would prefer to avoid parsing /sbin/ifconfig since
a) I don’t know how reliable it would be (and it’s ugly anyway)
b) I cannot get sample output to work on since I have no access to the
remote machine (I was planning on somebody installing my script that)
[Context: I’m binding a socket to that interface and sending the IP and
port info w/ UDP to another computer (server) behind a firewall that then
connects to the client. This is all required because of quite draconian
firewalling rules (my machine is behind THREE different firewalls,
ouch!)]
I cannot do a reverse DNS
lookup since the associated name is dynamic too
You could always register with dyndns.org(it’s free!) and have a
program like ddclient auto-refresh your DNS entry whenever you
connect to the net. That’s what I’m doing with my DSL connection
at home, and I can retrieve my remote IP as easy as:
Great! I have been reading ifconfig’s (net-tools’s) sources, and
apparently that info is taken from /proc/net/ (under Linux at least) and
using ioctl, and I guess parsing is more portable than trying ioctl
magic…
···
On Mon, Jan 27, 2003 at 07:37:38AM +0900, Eric Hodel wrote:
I need to get the dynamic IP address of the ppp0 interface
(point-to-point) under Linux. I cannot do a reverse DNS
lookup since the associated name is dynamic too (something like
user-bla-bla-IP-.someisp.com), and I would prefer to avoid parsing /sbin/ifconfig since
a) I don’t know how reliable it would be (and it’s ugly anyway)
b) I cannot get sample output to work on since I have no access to the
remote machine (I was planning on somebody installing my script that)
[Context: I’m binding a socket to that interface and sending the IP and
port info w/ UDP to another computer (server) behind a firewall that then
connects to the client. This is all required because of quite draconian
firewalling rules (my machine is behind THREE different firewalls,
ouch!)]
Great! I have been reading ifconfig’s (net-tools’s) sources, and
apparently that info is taken from /proc/net/ (under Linux at least) and
using ioctl, and I guess parsing is more portable than trying ioctl
magic…