I guess I should have mentioned that I am using a Lucent Wavelan card in my
PowerBook on an Airport network :) That is why it is en1 instead of en0
which would be your normal ethernet port.
Regards,
Tim
on 08/23/2001 7:46 PM, Bohdan Peter Rekshynskyj at [EMAIL PROTECTED] wrote:
> At 19:37 -0500 8/23/2001, Timothy A. Canon wrote:
>> Thanks for the tip. From the command line this works for me:
>>
>> /usr/sbin/ipconfig getifaddr en1
>
>
> I don't agree here - this showed me an old ip address.
>
> I used en0 instead to show my dynamic address assigned by dhcp...
>
> Please advise.
>
>
> Bohdan
>
>
>
>>
>> Now I just need to put it in a perl script. A quick look on CPAN turned up
>> Sys::HostIP which was basically doing the same thing.
>>
>> Thanks,
>>
>> Tim
>>
>> On Thursday, August 23, 2001, at 04:50 PM, Craig S. Cottingham wrote:
>>
>>> On Thursday, August 23, 2001, at 04:36 , Justin Simoni wrote:
>>>
>>>> What I do (I use @home) which uses DHCP. That fills in the IP addy for me,
>>>> and then I switch the network configuration to 'Manual' - I use the IP
>>>> addy that I got from the DHCP server and just lock it in!
>>>>
>>>> That way, you'll always have the same IP address and if you need to, you
>>>> can just hardcode that addy in any scripts you have!
>>>>
>>>> sneaky sneaky.
>>>
>>> Until your DHCP lease runs out and your IP address becomes invalid (or
>>> worse, is handed out to another user), at which point it becomes "foolish
>>> foolish".
>>>
>>> A quick-and-dirty solution, compiled in Mail:
>>>
>>> my $iface = 'en0'; # change to ppp0? if dialup?
>>> my $ip = undef;
>>> (`/sbin/ifconfig $iface` =~ /inet\s+(\d{1,3}(\.\d{1,3}){3})/) and ($ip =
>>> $1);
>>>
>>> --
>>> Craig S. Cottingham
>>> [EMAIL PROTECTED]
>>> PGP key available from:
>>>
>>> ID=0xA2FFBE41, fingerprint=6AA8 2E28 2404 8A95 B8FC 7EFC 136F 0CEF A2FF BE41
>
- Re: IP Address with DHCP Justin Simoni
- Re: IP Address with DHCP Craig S. Cottingham
- Re: IP Address with DHCP Justin Simoni
- Re: IP Address with DHCP Bruce Van Allen
- Re: IP Address with DHCP Craig S. Cottingham
- Re: IP Address with DHCP Ian Ragsdale
- Re: IP Address with DHCP Justin Simoni
- Re: IP Address with DHCP Bas A . Schulte
- Re: IP Address with DHCP Timothy A. Canon
- Re: IP Address with DHCP Bohdan Peter Rekshynskyj
- Re: IP Address with DHCP Timothy A. Canon
- Re: IP Address with DHCP Timothy A. Canon
- Re: IP Address with DHCP Bruce Van Allen
- Re: IP Address with DHCP Sean P. Scanlon
- Re: IP Address with DHCP Bruce Van Allen
- Re: IP Address with DHCP Craig S. Cottingham
- Re: IP Address with DHCP Wilfredo Sánchez
- Re: IP Address with DHCP John W Baxter