[Vm-dev] Finding ip address for eth0?
John M McIntosh
johnmci at smalltalkconsulting.com
Wed Aug 26 20:45:37 UTC 2009
NetNameResolver addressesForName: self localHostName
but that gives back a list of three address like
10.37.129.2(10.37.129.2),0(0)-inet4-stream-tcp
but lacking is information about WHICH one is actually usable, the
192.168.1.139 is the correct one for my office subnet
but 10.211.55.2, and 10.37.129.2 have been setup by Parallels for os-
x, If I pick 10.211.55.2, or 10.37.129 then things just won't
work since computer B elsewhere in the office doesn't see the 10.*.*.*
addresses.
Obviously the data coming back has to be a bit more helpful to let the
smalltalk code pick the right answer.
ifconfig shows
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe80::21b:63ff:fe02:d2db%en1 prefixlen 64 scopeid 0x6
inet 192.168.1.139 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:1b:63:02:d2:db
media: autoselect status: active
supported media: autoselect
en4: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST>
mtu 1500
inet6 fe80::21c:42ff:fe00:8%en4 prefixlen 64 scopeid 0x8
inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255
ether 00:1c:42:00:00:08
media: autoselect status: active
supported media: autoselect
en5: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST>
mtu 1500
inet6 fe80::21c:42ff:fe00:9%en5 prefixlen 64 scopeid 0x9
inet 10.37.129.2 netmask 0xffffff00 broadcast 10.37.129.255
ether 00:1c:42:00:00:09
media: autoselect status: active
supported media: autoselect
On 26-Aug-09, at 1:27 PM, Andreas Raab wrote:
> Bert Freudenberg wrote:
>> What got implemented though is a primitive to list all interfaces
>> that are available. Hosts do not have IP addresses, interfaces do.
>> And since hosts typically have multiple interfaces, it's not really
>> up to the VM to pick one, but the application.
>
> What's the primitive? How do I use it? Any examples?
>
> Thanks,
> - Andreas
--
=
=
=
========================================================================
John M. McIntosh <johnmci at smalltalkconsulting.com> Twitter:
squeaker68882
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
=
=
=
========================================================================
More information about the Vm-dev
mailing list