[PD] IP address of local machine

Jack jack at rybn.org
Sat Dec 16 21:26:12 CET 2017

Hello Roman,

Your router has a public and local IP. So, i guess your local machine
has only a local IP. Then, your local machine need to pass through your
router to access remote server. Your router has NAT rules to know which
local machine to route the content from the remote server.
I don't really understand what exactly you are looking for, but here
some possible answer (on linux) :

to get your ip address (local)
$ ip addr
to get the IP address (local) of the router :
$ ip route
to get the public address of the router :
$ curl -s http://whatismyip.akamai.com/
$ netcat -w 5 4.ifcfg.me 23
$ nc -w 5 4.ifcfg.me 23

There is also other command lines (ifconfig (instead of ip addr), route
-n (instead ip route), etc.).


Le 16/12/2017 à 17:35, Roman Haefeli a écrit :
> Hey all
> Is there a simple cross-platform way for a patch to know the main IP
> address of the local machine? Assume the patch is connected to a remote
> server and is able to request its public IP address. What I like to
> find out is if the local patch is communicating through NAT or directly
> to the remote server. 
> An incoming IP packet from the remote server would contain that
> information in the destination IP address field of the IP header, but
> the network objects I'm using ([tcpclient] and [udpclient]) don't
> expose that information. 
> Maybe there are other ways?
> Roman
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20171216/ef5a372b/attachment-0001.sig>

More information about the Pd-list mailing list