Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  IO::INTERFACE::SIMPLE (3)

.ds Aq ’


IO::Interface::Simple - Perl extension for access to network card configuration information



 use IO::Interface::Simple;

 my $if1   = IO::Interface::Simple->new(eth0);
 my $if2   = IO::Interface::Simple->new_from_address(;
 my $if3   = IO::Interface::Simple->new_from_index(1);

 my @interfaces = IO::Interface::Simple->interfaces;

 for my $if (@interfaces) {
    print "interface = $if\n";
    print "addr =      ",$if->address,"\n",
          "broadcast = ",$if->broadcast,"\n",
          "netmask =   ",$if->netmask,"\n",
          "dstaddr =   ",$if->dstaddr,"\n",
          "hwaddr =    ",$if->hwaddr,"\n",
          "mtu =       ",$if->mtu,"\n",
          "metric =    ",$if->metric,"\n",
          "index =     ",$if->index,"\n";

    print "is running\n"     if $if->is_running;
    print "is broadcast\n"   if $if->is_broadcast;
    print "is p-to-p\n"      if $if->is_pt2pt;
    print "is loopback\n"    if $if->is_loopback;
    print "is promiscuous\n" if $if->is_promiscuous;
    print "is multicast\n"   if $if->is_multicast;
    print "is notrailers\n"  if $if->is_notrailers;
    print "is noarp\n"       if $if->is_noarp;


IO::Interface::Simple allows you to interrogate and change network interfaces. It has overlapping functionality with Net::Interface, but might compile and run on more platforms.

    Class Methods

$interface = IO::Interface::Simple->new(’eth0’) Given an interface name, new() creates an interface object.
@iflist = IO::Interface::Simple->interfaces; Returns a list of active interface objects.
$interface = IO::Interface::Simple->new_from_address(’’) Returns the interface object corresponding to the given address.
$interface = IO::Interface::Simple->new_from_index(2) Returns the interface object corresponding to the given numeric index. This is only supported on BSD-ish platforms.

    Object Methods

$name = $interface->name Get the name of the interface. The interface object is also overloaded so that if you use it in a string context it is the same as calling name().
$index = $interface->index Get the index of the interface. This is only supported on BSD-like platforms.
$addr = $interface->address([$newaddr]) Get or set the interface’s address.
$addr = $interface->broadcast([$newaddr]) Get or set the interface’s broadcast address.
$addr = $interface->netmask([$newmask]) Get or set the interface’s netmask.
$addr = $interface->hwaddr([$newaddr]) Get or set the interface’s hardware address.
$addr = $interface->mtu([$newmtu]) Get or set the interface’s MTU.
$addr = $interface->metric([$newmetric]) Get or set the interface’s metric.
$flags = $interface->flags([$newflags]) Get or set the interface’s flags. These can be ANDed with the IFF constants exported by IO::Interface or Net::Interface in order to interrogate the state and capabilities of the interface. However, it is probably more convenient to use the broken-out methods listed below.
$flag = $interface->is_running([$newflag])
$flag = $interface->is_broadcast([$newflag])
$flag = $interface->is_pt2pt([$newflag])
$flag = $interface->is_loopback([$newflag])
$flag = $interface->is_promiscuous([$newflag])
$flag = $interface->is_multicast([$newflag])
$flag = $interface->is_notrailers([$newflag])
$flag = $interface->is_noarp([$newflag]) Get or set the corresponding configuration parameters. Note that the operating system may not let you set some of these.


Lincoln D. Stein <> Copyright 2001-2014, Lincoln D. Stein.

This library is distributed under the Perl Artistic License 2.0. Please see LICENSE for more information.


For feature requests, bug reports and code contributions, please use the GitHub repository at


perl, IO::Socket, IO::Multicast), IO::Interface, Net::Interface
Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 IO::INTERFACE::SIMPLE (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.