Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

CUrrently, I am using the perl IO::Socket::Simple cpan module to perform manipulations to the current interfaces in freebsd. However, this seems to lack the ability to add an alias ip address to an ethernet nic. How would you suggest i go about doing this. I have kicked the idea of just using ifconfig to perform the relevant changes but it seems to be counter productive as we will not be able to retrieve the information when later configuring the interface. Any ideas?

Replies are listed 'Best First'.
Re: Setting interface alias with perl
by moritz (Cardinal) on Aug 20, 2008 at 21:37 UTC
    I have kicked the idea of just using ifconfig to perform the relevant changes but it seems to be counter productive as we will not be able to retrieve the information when later configuring the interface.

    I think ifconfig is the way to go, and I don't understand your concern. Which information exactly can't be retrieved later? If it's connected the alias you just created - you know its name in your program already, so no need to retrieve that later on.

      This was my post earlier and for some odd reason my login details were not associated with the post. I see your point. The issue that I envisioned was that this is part of a small configuration wizard I am writing for an appliance and there will be some reason to revisit the config wizard later. At this point it would be advantageous to be able to get all ip addresses on the interface both primary and aliases. I can get around this by saving the interface data in a small xml config file. So non starter but I was hoping to add that support directly to Io::Interface::Simple. This leads me to ask how I can contribute to CPAN, I have never done so and was wondering how one goes about contributing.
        The simplest approach to contributing is downloading the module, adding a feature, and then sending the diff/patch to the author, and the bug queue (at rt://IO::Interface::Simple).

        The Author, Lincoln Stein, has updated two of his modules this month already, so you can assume he's still active and will consider your patch.

        Be sure to also add test cases for newly implemented features.

Re: Setting interface alias with perl
by Perlbotics (Archbishop) on Aug 20, 2008 at 22:27 UTC